diff --git a/lib/reducers/services-access-token-reducer.js b/lib/reducers/services-access-token-reducer.js --- a/lib/reducers/services-access-token-reducer.js +++ b/lib/reducers/services-access-token-reducer.js @@ -3,8 +3,6 @@ import { logOutActionTypes, setAccessTokenActionType, - identityRegisterActionTypes, - identityLogInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; @@ -26,11 +24,6 @@ return null; } else if (action.type === logOutActionTypes.started) { return null; - } else if ( - action.type === identityRegisterActionTypes.success || - action.type === identityLogInActionTypes.success - ) { - return action.payload.accessToken; } return state; } diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -174,27 +174,22 @@ }; } - state = resetUserSpecificState( - state, - defaultState, - nonUserSpecificFieldsNative, - ); - } else if (action.type === identityRegisterActionTypes.success) { state = resetUserSpecificState( state, defaultState, nonUserSpecificFieldsNative, ); } else if ( - action.type === identityLogInActionTypes.success && - action.payload.userID !== action.payload.preRequestUserState?.id + action.type === identityRegisterActionTypes.success || + (action.type === identityLogInActionTypes.success && + action.payload.userID !== action.payload.preRequestUserState?.id) ) { - state = resetUserSpecificState( - state, - defaultState, - nonUserSpecificFieldsNative, - ); + state = resetUserSpecificState(state, defaultState, [ + ...nonUserSpecificFieldsNative, + 'commServicesAccessToken', + ]); } + if ( (action.type === setNewSessionActionType && action.payload.sessionChange.currentUserInfo &&