diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -560,15 +560,15 @@ return identityClient.logInWalletUser; } -const logInActionTypes = Object.freeze({ - started: 'LOG_IN_STARTED', - success: 'LOG_IN_SUCCESS', - failed: 'LOG_IN_FAILED', +const legacyLogInActionTypes = Object.freeze({ + started: 'LEGACY_LOG_IN_STARTED', + success: 'LEGACY_LOG_IN_SUCCESS', + failed: 'LEGACY_LOG_IN_FAILED', }); -const logInCallSingleKeyserverEndpointOptions = { +const legacyLogInCallSingleKeyserverEndpointOptions = { timeout: permissionsAndAuthRelatedRequestTimeout, }; -const logIn = +const legacyLogIn = ( callKeyserverEndpoint: CallKeyserverEndpoint, ): ((input: LogInInfo) => Promise) => @@ -609,7 +609,7 @@ await callKeyserverEndpoint( 'log_in', requests, - logInCallSingleKeyserverEndpointOptions, + legacyLogInCallSingleKeyserverEndpointOptions, ); const userInfosArrays = []; @@ -671,8 +671,8 @@ }; }; -function useLogIn(): (input: LogInInfo) => Promise { - return useKeyserverCall(logIn); +function useLegacyLogIn(): (input: LogInInfo) => Promise { + return useKeyserverCall(legacyLogIn); } const changeKeyserverUserPasswordActionTypes = Object.freeze({ @@ -862,12 +862,12 @@ getOlmSessionInitializationDataActionTypes, getOlmSessionInitializationData, mergeUserInfos, - logIn as logInRawAction, + legacyLogIn as legacyLogInRawAction, identityLogInActionTypes, useIdentityPasswordLogIn, useIdentityWalletLogIn, - useLogIn, - logInActionTypes, + useLegacyLogIn, + legacyLogInActionTypes, useLogOut, logOutActionTypes, keyserverRegister, diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js --- a/lib/reducers/calendar-filters-reducer.js +++ b/lib/reducers/calendar-filters-reducer.js @@ -14,7 +14,7 @@ import { keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; @@ -52,7 +52,7 @@ threadStore: ThreadStore, ): $ReadOnlyArray { if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success ) { diff --git a/lib/reducers/data-loaded-reducer.js b/lib/reducers/data-loaded-reducer.js --- a/lib/reducers/data-loaded-reducer.js +++ b/lib/reducers/data-loaded-reducer.js @@ -4,7 +4,7 @@ import { keyserverAuthActionTypes, logOutActionTypes, - logInActionTypes, + legacyLogInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; @@ -17,7 +17,7 @@ ): boolean { if (action.type === setDataLoadedActionType) { return action.payload.dataLoaded; - } else if (action.type === logInActionTypes.success) { + } else if (action.type === legacyLogInActionTypes.success) { return true; } else if ( action.type === setNewSessionActionType && diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js --- a/lib/reducers/entry-reducer.js +++ b/lib/reducers/entry-reducer.js @@ -37,7 +37,7 @@ import { keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import { entryID } from '../shared/entry-utils.js'; @@ -480,7 +480,7 @@ [], ]; } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverAuthActionTypes.success ) { diff --git a/lib/reducers/integrity-reducer.js b/lib/reducers/integrity-reducer.js --- a/lib/reducers/integrity-reducer.js +++ b/lib/reducers/integrity-reducer.js @@ -5,7 +5,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { keyserverAuthActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; @@ -80,7 +80,7 @@ integrityStoreOperations: [removeAllOperation, replaceOperation], }; } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success || (action.type === setClientDBStoreActionType && diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js --- a/lib/reducers/keyserver-reducer.js +++ b/lib/reducers/keyserver-reducer.js @@ -22,7 +22,7 @@ deleteKeyserverAccountActionTypes, deleteAccountActionTypes, keyserverRegisterActionTypes, - logInActionTypes, + legacyLogInActionTypes, } from '../actions/user-actions.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import { @@ -189,7 +189,7 @@ keyserverStoreOperations: operations, }; } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverAuthActionTypes.success ) { diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js --- a/lib/reducers/master-reducer.js +++ b/lib/reducers/master-reducer.js @@ -28,7 +28,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { keyserverRegisterActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverAuthActionTypes, } from '../actions/user-actions.js'; import { @@ -93,7 +93,7 @@ action.type !== incrementalStateSyncActionType && action.type !== fullStateSyncActionType && action.type !== keyserverRegisterActionTypes.success && - action.type !== logInActionTypes.success && + action.type !== legacyLogInActionTypes.success && action.type !== siweAuthActionTypes.success && action.type !== keyserverAuthActionTypes.success && action.type !== addKeyserverActionType diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -49,7 +49,7 @@ import { keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -727,7 +727,7 @@ newThreadInfos: RawThreadInfos, ): ReduceMessageStoreResult { if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success ) { const { messagesResult } = action.payload; diff --git a/lib/reducers/nav-reducer.js b/lib/reducers/nav-reducer.js --- a/lib/reducers/nav-reducer.js +++ b/lib/reducers/nav-reducer.js @@ -4,7 +4,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { identityRegisterActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, logOutActionTypes, deleteAccountActionTypes, @@ -24,7 +24,7 @@ action: BaseAction, ): T { if ( - action.type === logInActionTypes.started || + action.type === legacyLogInActionTypes.started || action.type === siweAuthActionTypes.started || action.type === keyserverRegisterActionTypes.started || action.type === fullStateSyncActionType || diff --git a/lib/reducers/policies-reducer.js b/lib/reducers/policies-reducer.js --- a/lib/reducers/policies-reducer.js +++ b/lib/reducers/policies-reducer.js @@ -2,7 +2,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { - logInActionTypes, + legacyLogInActionTypes, logOutActionTypes, policyAcknowledgmentActionTypes, keyserverAuthActionTypes, @@ -20,7 +20,7 @@ ): UserPolicies { if ( action.type === forcePolicyAcknowledgmentActionType || - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverAuthActionTypes.success ) { diff --git a/lib/reducers/report-store-reducer.js b/lib/reducers/report-store-reducer.js --- a/lib/reducers/report-store-reducer.js +++ b/lib/reducers/report-store-reducer.js @@ -10,7 +10,7 @@ import { logOutActionTypes, deleteAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { ReportStoreOperation } from '../ops/report-store-ops.js'; @@ -104,7 +104,7 @@ reportStoreOperations: [{ type: 'remove_all_reports' }], }; } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success ) { return { diff --git a/lib/reducers/report-store-reducer.test.js b/lib/reducers/report-store-reducer.test.js --- a/lib/reducers/report-store-reducer.test.js +++ b/lib/reducers/report-store-reducer.test.js @@ -109,7 +109,7 @@ test('should handle log in', () => { const action = { - type: 'LOG_IN_SUCCESS', + type: 'LEGACY_LOG_IN_SUCCESS', payload: mockLogInResult, loadingInfo, }; @@ -123,7 +123,7 @@ test('should handle log in with new inconsistencies', () => { const action = { - type: 'LOG_IN_SUCCESS', + type: 'LEGACY_LOG_IN_SUCCESS', payload: mockLogInResult, loadingInfo, }; 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 @@ -3,7 +3,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { updateThemeInfoActionType } from '../actions/theme-actions.js'; import { - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -20,7 +20,7 @@ action: BaseAction, ): GlobalThemeInfo { if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success ) { diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -21,7 +21,7 @@ import { keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, updateSubscriptionActionTypes, } from '../actions/user-actions.js'; @@ -107,7 +107,7 @@ threadStoreOperations, }; } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success ) { 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 @@ -15,7 +15,7 @@ deleteAccountActionTypes, keyserverAuthActionTypes, logOutActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverRegisterActionTypes, setUserSettingsActionTypes, updateUserAvatarActionTypes, @@ -65,7 +65,7 @@ return newUserInfo; } } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success || action.type === logOutActionTypes.success || @@ -271,7 +271,7 @@ ]; } } else if ( - action.type === logInActionTypes.success || + action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success ) { diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -387,18 +387,18 @@ +loadingInfo: LoadingInfo, } | { - +type: 'LOG_IN_STARTED', + +type: 'LEGACY_LOG_IN_STARTED', +loadingInfo: LoadingInfo, +payload: LogInStartingPayload, } | { - +type: 'LOG_IN_FAILED', + +type: 'LEGACY_LOG_IN_FAILED', +error: true, +payload: Error, +loadingInfo: LoadingInfo, } | { - +type: 'LOG_IN_SUCCESS', + +type: 'LEGACY_LOG_IN_SUCCESS', +payload: LogInResult, +loadingInfo: LoadingInfo, } diff --git a/native/account/legacy-recover-keyserver-session.js b/native/account/legacy-recover-keyserver-session.js --- a/native/account/legacy-recover-keyserver-session.js +++ b/native/account/legacy-recover-keyserver-session.js @@ -1,6 +1,9 @@ // @flow -import { logInActionTypes, logInRawAction } from 'lib/actions/user-actions.js'; +import { + legacyLogInActionTypes, + legacyLogInRawAction, +} from 'lib/actions/user-actions.js'; import type { CallSingleKeyserverEndpoint } from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import { type CallKeyserverEndpoint, @@ -48,8 +51,8 @@ authActionSource: recoveryActionSource, }; await dispatchActionPromise( - logInActionTypes, - logInRawAction(callKeyserverEndpoint)({ + legacyLogInActionTypes, + legacyLogInRawAction(callKeyserverEndpoint)({ ...keychainCredentials, ...extraInfo, authActionSource: recoveryActionSource, diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js --- a/native/account/log-in-panel.react.js +++ b/native/account/log-in-panel.react.js @@ -6,8 +6,8 @@ import Animated from 'react-native-reanimated'; import { - logInActionTypes, - useLogIn, + legacyLogInActionTypes, + useLegacyLogIn, getOlmSessionInitializationDataActionTypes, useIdentityPasswordLogIn, identityLogInActionTypes, @@ -260,7 +260,7 @@ ); } else { void this.props.dispatchActionPromise( - logInActionTypes, + legacyLogInActionTypes, this.legacyLogInAction({ ...extraInfo, initialNotificationsEncryptedMessage, @@ -422,8 +422,9 @@ }, }); -const logInLoadingStatusSelector = - createLoadingStatusSelector(logInActionTypes); +const logInLoadingStatusSelector = createLoadingStatusSelector( + legacyLogInActionTypes, +); const olmSessionInitializationDataLoadingStatusSelector = createLoadingStatusSelector(getOlmSessionInitializationDataActionTypes); @@ -441,7 +442,7 @@ const logInExtraInfo = useSelector(nativeLogInExtraInfoSelector); const dispatchActionPromise = useDispatchActionPromise(); - const callLegacyLogIn = useLogIn(); + const callLegacyLogIn = useLegacyLogIn(); const callIdentityPasswordLogIn = useIdentityPasswordLogIn(); const getInitialNotificationsEncryptedMessage = useInitialNotificationsEncryptedMessage(authoritativeKeyserverID); 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 @@ -10,7 +10,7 @@ import { logOutActionTypes, deleteAccountActionTypes, - logInActionTypes, + legacyLogInActionTypes, keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, } from 'lib/actions/user-actions.js'; @@ -182,7 +182,7 @@ action.payload.preRequestUserState?.currentUserInfo, action.payload.authActionSource, )) || - ((action.type === logInActionTypes.success || + ((action.type === legacyLogInActionTypes.success || action.type === siweAuthActionTypes.success) && invalidSessionRecovery( state, diff --git a/web/account/traditional-login-form.react.js b/web/account/traditional-login-form.react.js --- a/web/account/traditional-login-form.react.js +++ b/web/account/traditional-login-form.react.js @@ -4,8 +4,8 @@ import * as React from 'react'; import { - useLogIn, - logInActionTypes, + useLegacyLogIn, + legacyLogInActionTypes, useIdentityPasswordLogIn, identityLogInActionTypes, } from 'lib/actions/user-actions.js'; @@ -34,11 +34,13 @@ import Input from '../modals/input.react.js'; import { useSelector } from '../redux/redux-utils.js'; -const loadingStatusSelector = createLoadingStatusSelector(logInActionTypes); +const loadingStatusSelector = createLoadingStatusSelector( + legacyLogInActionTypes, +); function TraditionalLoginForm(): React.Node { const inputDisabled = useSelector(loadingStatusSelector) === 'loading'; const loginExtraInfo = useSelector(logInExtraInfoSelector); - const callLegacyLogIn = useLogIn(); + const callLegacyLogIn = useLegacyLogIn(); const callIdentityPasswordLogIn = useIdentityPasswordLogIn(); const dispatchActionPromise = useDispatchActionPromise(); @@ -153,7 +155,7 @@ ); } else { void dispatchActionPromise( - logInActionTypes, + legacyLogInActionTypes, legacyLogInAction(loginExtraInfo), undefined, ({