1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 1x 1x 1x 1x 1x 1x 1x 1x 1x |
export const reducers = {
'log out' (state, action) {
return {}
},
'set auth0 user' (state, action) {
return {
...state,
...action.payload
}
},
'set id token' (state, action) {
return {
...state,
idToken: action.payload
}
}
}
const localStorageAvailable = typeof window !== 'undefined' &&
typeof window.localStorage !== 'undefined' &&
typeof window.localStorage.getItem === 'function'
export const initialState = {
...JSON.parse(localStorageAvailable ? window.localStorage.getItem('user') : '{}')
}
|