mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix hot bugs.
This commit is contained in:
@@ -3,6 +3,7 @@ import t from 'store/types';
|
||||
|
||||
const initialState = {
|
||||
token: '',
|
||||
organization: '',
|
||||
user: '',
|
||||
locale: '',
|
||||
errors: [],
|
||||
@@ -10,8 +11,10 @@ const initialState = {
|
||||
|
||||
export default createReducer(initialState, {
|
||||
[t.LOGIN_SUCCESS]: (state, action) => {
|
||||
state.token = action.token;
|
||||
state.user = action.user;
|
||||
const { token, user } = action.payload;
|
||||
state.token = token;
|
||||
state.user = user;
|
||||
state.organization = user.tenant.organization_id;
|
||||
},
|
||||
|
||||
[t.LOGIN_FAILURE]: (state, action) => {
|
||||
@@ -21,6 +24,7 @@ export default createReducer(initialState, {
|
||||
[t.LOGOUT]: (state) => {
|
||||
state.token = '';
|
||||
state.user = {};
|
||||
state.organization = '';
|
||||
},
|
||||
|
||||
[t.LOGIN_CLEAR_ERRORS]: (state) => {
|
||||
|
||||
Reference in New Issue
Block a user