diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 23:33:50 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 23:33:50 +0100 |
| commit | f6e6b1edbbb68bf6bf93a10deebd4cd55ffaff0f (patch) | |
| tree | bb44de81746cfd088bfab49247b9ec8508bb4605 /animism-align/frontend/app/views/auth/auth.reducer.js | |
| parent | 6726fa9fe050aa47ff7f537b91705372e290f501 (diff) | |
use other login validator thingie
Diffstat (limited to 'animism-align/frontend/app/views/auth/auth.reducer.js')
| -rw-r--r-- | animism-align/frontend/app/views/auth/auth.reducer.js | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/animism-align/frontend/app/views/auth/auth.reducer.js b/animism-align/frontend/app/views/auth/auth.reducer.js index 05741f3..8c652ff 100644 --- a/animism-align/frontend/app/views/auth/auth.reducer.js +++ b/animism-align/frontend/app/views/auth/auth.reducer.js @@ -3,8 +3,7 @@ import { getDefault } from 'app/session' const initialState = { logged_in: !!getDefault('access_token', false), - user_id: null, - user: null, + user: {}, } export default function authReducer(state = initialState, action) { @@ -14,25 +13,13 @@ export default function authReducer(state = initialState, action) { return { ...state, logged_in: true, - user_id: action.user_id, - user: null, + user: action.user, } case types.auth.logged_out: return { ...state, logged_in: false, - user_id: null, - user: null, - } - case types.user.show: - if (action.data.res.id !== state.user_id) { - return state - } - return { - ...state, - user: { - ...action.data.res, - } + user: {}, } default: return state |
