File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " freenit" ,
3
- "version" : " 0.1.4 " ,
3
+ "version" : " 0.1.5 " ,
4
4
"private" : false ,
5
5
"description" : " Freenit framework" ,
6
6
"author" : " Goran Mekić" ,
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ import { BrowserRouter as Router } from 'react-router-dom'
4
4
import { ThemeProvider } from '@material-ui/styles'
5
5
import { Style } from 'radium'
6
6
7
- import Routing from 'routing'
8
- import theme from 'theme'
9
- import styles from 'styles'
7
+ import Routing from './routing'
8
+ import styles from './styles'
9
+ import theme from './theme'
10
+ import { auth } from './auth'
11
+
12
+
13
+ auth . init ( '/api/v0' )
10
14
11
15
12
16
const App = ( ) => {
Original file line number Diff line number Diff line change
1
+ import { rest } from './utils'
2
+
3
+
1
4
class Auth
2
5
{
3
6
access = { expire : null , date : null }
4
7
refresh = { expire : null , data : null }
5
8
6
- constructor ( ) {
7
- this . refresh ( )
9
+ init = async ( api ) => {
10
+ window . rest = rest ( api )
11
+ window . rest . API_ROOT = api
12
+ await this . refresh ( )
8
13
}
9
14
10
15
login = async ( email , password ) => {
Original file line number Diff line number Diff line change @@ -10,16 +10,10 @@ import {
10
10
Landing ,
11
11
Role ,
12
12
User ,
13
- rest ,
14
- } from './lib'
15
-
16
-
17
- const API_ROOT = '/api/v0'
13
+ } from './pages'
18
14
19
15
20
16
const Routing = ( ) => {
21
- window . rest = rest ( API_ROOT )
22
- window . rest . API_ROOT = API_ROOT
23
17
return (
24
18
< Switch >
25
19
< Route exact path = "/" component = { Landing . Detail } />
You can’t perform that action at this time.
0 commit comments