diff --git a/lib/reducers/enabled-apps-reducer.js b/lib/reducers/enabled-apps-reducer.js --- a/lib/reducers/enabled-apps-reducer.js +++ b/lib/reducers/enabled-apps-reducer.js @@ -1,7 +1,7 @@ // @flow import { - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, logOutActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -11,6 +11,7 @@ defaultWebEnabledApps, } from '../types/enabled-apps.js'; import type { BaseAction } from '../types/redux-types.js'; +import { usingCommServicesAccessToken } from '../utils/services-utils.js'; export const enableAppActionType = 'ENABLE_APP'; export const disableAppActionType = 'DISABLE_APP'; @@ -28,11 +29,16 @@ return { ...state, calendar: false }; } else if ( action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || - (action.type === setNewSessionActionType && - action.payload.sessionChange.cookieInvalidated) + action.type === deleteAccountActionTypes.success ) { return process.env.BROWSER ? defaultWebEnabledApps : defaultEnabledApps; + } else if ( + action.type === setNewSessionActionType && + action.payload.sessionChange.cookieInvalidated + ) { + if (!usingCommServicesAccessToken) { + return process.env.BROWSER ? defaultWebEnabledApps : defaultEnabledApps; + } } return state; } 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 @@ -2,7 +2,7 @@ import { logOutActionTypes, - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, setAccessTokenActionType, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -23,7 +23,7 @@ } else if ( action.type === logOutActionTypes.started || action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success + action.type === deleteAccountActionTypes.success ) { return null; } diff --git a/lib/reducers/theme-reducer.js b/lib/reducers/theme-reducer.js --- a/lib/reducers/theme-reducer.js +++ b/lib/reducers/theme-reducer.js @@ -4,7 +4,7 @@ import { updateThemeInfoActionType } from '../actions/theme-actions.js'; import { logOutActionTypes, - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, logInActionTypes, tempIdentityLoginActionTypes, keyserverRegisterActionTypes, @@ -36,7 +36,7 @@ } else if ( action.type === logOutActionTypes.started || action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success + action.type === deleteAccountActionTypes.success ) { return defaultGlobalThemeInfo; } else if (action.type === updateThemeInfoActionType) { diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -13,7 +13,6 @@ deleteAccountActionTypes, keyserverAuthActionTypes, logOutActionTypes, - deleteKeyserverAccountActionTypes, logInActionTypes, keyserverRegisterActionTypes, setUserSettingsActionTypes, @@ -59,7 +58,7 @@ action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success || action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success + action.type === deleteAccountActionTypes.success ) { if (!_isEqual(action.payload.currentUserInfo)(state)) { return action.payload.currentUserInfo; 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 @@ -9,9 +9,10 @@ import { siweAuthActionTypes } from 'lib/actions/siwe-actions.js'; import { logOutActionTypes, - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, logInActionTypes, keyserverAuthActionTypes, + deleteKeyserverAccountActionTypes, } from 'lib/actions/user-actions.js'; import { setNewSessionActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import type { ThreadStoreOperation } from 'lib/ops/thread-store-ops.js'; @@ -123,6 +124,13 @@ ashoatKeyserverID, )) || (action.type === deleteKeyserverAccountActionTypes.success && + invalidSessionDowngrade( + state, + action.payload.currentUserInfo, + action.payload.preRequestUserState, + ashoatKeyserverID, + )) || + (action.type === deleteAccountActionTypes.success && invalidSessionDowngrade( state, action.payload.currentUserInfo, @@ -194,7 +202,7 @@ } else if ( action.type === logOutActionTypes.started || action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success + action.type === deleteAccountActionTypes.success ) { state = { ...state, diff --git a/web/redux/crypto-store-reducer.js b/web/redux/crypto-store-reducer.js --- a/web/redux/crypto-store-reducer.js +++ b/web/redux/crypto-store-reducer.js @@ -2,10 +2,11 @@ import { logOutActionTypes, - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, } from 'lib/actions/user-actions.js'; import { setNewSessionActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import type { CryptoStore } from 'lib/types/crypto-types.js'; +import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js'; import type { Action } from './redux-setup.js'; @@ -16,11 +17,16 @@ return action.payload; } else if ( action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || - (action.type === setNewSessionActionType && - action.payload.sessionChange.cookieInvalidated) + action.type === deleteAccountActionTypes.success ) { return null; + } else if ( + action.type === setNewSessionActionType && + action.payload.sessionChange.cookieInvalidated + ) { + if (!usingCommServicesAccessToken) { + return null; + } } return state; }