diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -9,6 +9,7 @@ deleteAccountActionTypes, identityRegisterActionTypes, identityLogInActionTypes, + keyserverAuthActionTypes, } from 'lib/actions/user-actions.js'; import { setNewSessionActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { @@ -27,6 +28,7 @@ import { invalidSessionDowngrade, identityInvalidSessionDowngrade, + invalidSessionRecovery, } from 'lib/shared/session-utils.js'; import type { CommunityStore } from 'lib/types/community-types.js'; import type { MessageID, DBOpsStore } from 'lib/types/db-ops-types.js'; @@ -154,6 +156,24 @@ integrityStoreOperations: [], }; + if ( + (action.type === setNewSessionActionType && + action.payload.sessionChange.currentUserInfo && + invalidSessionRecovery( + state, + action.payload.sessionChange.currentUserInfo, + action.payload.authActionSource, + )) || + (action.type === keyserverAuthActionTypes.success && + invalidSessionRecovery( + state, + action.payload.preRequestUserInfo, + action.payload.authActionSource, + )) + ) { + return state; + } + if (action.type === setInitialReduxState) { const { userInfos, keyserverInfos, actualizedCalendarQuery, ...rest } = action.payload;