diff --git a/lib/reducers/services-access-token-reducer.js b/lib/reducers/services-access-token-reducer.js index 6fdda4146..0879df0d3 100644 --- a/lib/reducers/services-access-token-reducer.js +++ b/lib/reducers/services-access-token-reducer.js @@ -1,29 +1,32 @@ // @flow import { logOutActionTypes, setAccessTokenActionType, + identityRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; import { relyingOnAuthoritativeKeyserver } from '../utils/services-utils.js'; export default function reduceServicesAccessToken( state: ?string, action: BaseAction, ): ?string { if (action.type === setAccessTokenActionType) { return action.payload; } else if ( action.type === setNewSessionActionType && action.payload.sessionChange.cookieInvalidated && action.payload.keyserverID === authoritativeKeyserverID() && relyingOnAuthoritativeKeyserver ) { return null; } else if (action.type === logOutActionTypes.started) { return null; + } else if (action.type === identityRegisterActionTypes.success) { + return action.payload.accessToken; } return state; }