Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(reducers/auth): remove jwt token from state.me.auth
Browse files Browse the repository at this point in the history
feat(reducers/auth): remove jwt token from state.me.auth
  • Loading branch information
Metnew committed Sep 17, 2017
1 parent 037ba73 commit 1e23aea
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/common/reducers/auth/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// @flow
import {
isLoggedIn as hasLocalToken,
getLocalToken
} from 'api/LocalStorageCookiesSvc'
import {isLoggedIn as hasLocalToken} from 'api/LocalStorageCookiesSvc'
import {
LOGIN_AUTH_FAIL,
LOGIN_AUTH_PENDING,
Expand All @@ -23,7 +20,6 @@ export type State = {
isLoading: boolean,
isLoaded: boolean,
isLoggedIn: boolean,
token: string | null,
errors: Object
}

Expand All @@ -38,7 +34,6 @@ export const initialState: State = {
isLoading: false,
isLoaded: false,
isLoggedIn: hasLocalToken(),
token: getLocalToken(),
errors: {}
}

Expand All @@ -52,7 +47,6 @@ export function auth (state: State = initialState, action: Action): State {
isLoading: false,
isLoaded: true,
isLoggedIn: false,
token: null,
errors: {}
}
}
Expand All @@ -63,18 +57,15 @@ export function auth (state: State = initialState, action: Action): State {
isLoading: false,
isLoaded: true,
isLoggedIn: false,
token: null,
errors
}
}
case LOGIN_AUTH_SUCCESS: {
const {token} = action.payload
return {
...state,
isLoading: false,
isLoaded: true,
isLoggedIn: true,
token
isLoggedIn: true
}
}
case LOGIN_AUTH_PENDING: {
Expand Down

0 comments on commit 1e23aea

Please sign in to comment.