diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -190,7 +190,7 @@ calendarQuery: t.maybe(entryQueryInputValidator), deviceTokenUpdateRequest: t.maybe(deviceTokenUpdateRequestInputValidator), platformDetails: tPlatformDetails, - source: t.maybe(t.enums.of(values(loginActionSources))), + logInActionSource: t.maybe(t.enums.of(values(loginActionSources))), }); async function logInResponder( 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 @@ -143,7 +143,7 @@ }, userInfos, updatesCurrentAsOf: response.serverTime, - source: logInInfo.source, + logInActionSource: logInInfo.logInActionSource, }; }; diff --git a/lib/shared/account-utils.js b/lib/shared/account-utils.js --- a/lib/shared/account-utils.js +++ b/lib/shared/account-utils.js @@ -59,11 +59,12 @@ function invalidSessionRecovery( currentReduxState: AppState, actionCurrentUserInfo: CurrentUserInfo, - source: ?LogInActionSource, + logInActionSource: ?LogInActionSource, ): boolean { if ( - source !== loginActionSources.cookieInvalidationResolutionAttempt && - source !== loginActionSources.socketAuthErrorResolutionAttempt + logInActionSource !== + loginActionSources.cookieInvalidationResolutionAttempt && + logInActionSource !== loginActionSources.socketAuthErrorResolutionAttempt ) { return false; } diff --git a/lib/socket/socket.react.js b/lib/socket/socket.react.js --- a/lib/socket/socket.react.js +++ b/lib/socket/socket.react.js @@ -468,7 +468,8 @@ }, preRequestUserState: this.initializedWithUserState, error: null, - source: loginActionSources.socketAuthErrorResolutionAttempt, + logInActionSource: + loginActionSources.socketAuthErrorResolutionAttempt, }, }); } else if (!recoverySessionChange) { @@ -589,7 +590,7 @@ sessionChange: { cookieInvalidated: false, sessionID }, preRequestUserState: this.initializedWithUserState, error: null, - source: undefined, + logInActionSource: undefined, }, }); } diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -91,7 +91,7 @@ export type LogInStartingPayload = { +calendarQuery: CalendarQuery, - +source?: LogInActionSource, + +logInActionSource?: LogInActionSource, }; export type LogInExtraInfo = { @@ -103,7 +103,7 @@ ...LogInExtraInfo, +username: string, +password: string, - +source: LogInActionSource, + +logInActionSource: LogInActionSource, }; export type LogInRequest = { @@ -114,7 +114,7 @@ +deviceTokenUpdateRequest?: ?DeviceTokenUpdateRequest, +platformDetails: PlatformDetails, +watchedIDs: $ReadOnlyArray, - +source?: LogInActionSource, + +logInActionSource?: LogInActionSource, }; export type LogInResponse = { @@ -137,7 +137,7 @@ +userInfos: $ReadOnlyArray, +calendarResult: CalendarResult, +updatesCurrentAsOf: number, - +source: LogInActionSource, + +logInActionSource: LogInActionSource, }; export type UpdatePasswordRequest = { diff --git a/lib/types/session-types.js b/lib/types/session-types.js --- a/lib/types/session-types.js +++ b/lib/types/session-types.js @@ -88,7 +88,7 @@ sessionChange: ClientSessionChange, preRequestUserState: ?PreRequestUserState, error: ?string, - source: ?LogInActionSource, + logInActionSource: ?LogInActionSource, }; export type SessionState = { diff --git a/lib/utils/action-utils.js b/lib/utils/action-utils.js --- a/lib/utils/action-utils.js +++ b/lib/utils/action-utils.js @@ -161,11 +161,11 @@ sessionChange: ClientSessionChange, preRequestUserState: ?PreRequestUserState, error: ?string, - source: ?LogInActionSource, + logInActionSource: ?LogInActionSource, ) { dispatch({ type: setNewSessionActionType, - payload: { sessionChange, preRequestUserState, error, source }, + payload: { sessionChange, preRequestUserState, error, logInActionSource }, }); } @@ -178,7 +178,7 @@ dispatch: Dispatch, cookie: ?string, urlPrefix: string, - source: LogInActionSource, + logInActionSource: LogInActionSource, ): Promise { const resolveInvalidatedCookie = getConfig().resolveInvalidatedCookie; if (!resolveInvalidatedCookie) { @@ -196,7 +196,7 @@ error: ?string, ) => { newSessionChange = sessionChange; - setNewSession(dispatch, sessionChange, null, error, source); + setNewSession(dispatch, sessionChange, null, error, logInActionSource); }; try { const result = await callServerEndpoint( @@ -232,14 +232,14 @@ promise: Promise, inputStartingPayload: LogInStartingPayload, ) => { - const startingPayload = { ...inputStartingPayload, source }; + const startingPayload = { ...inputStartingPayload, logInActionSource }; dispatch(wrapActionPromise(actionTypes, promise, null, startingPayload)); return new Promise(r => (callServerEndpointCallback = r)); }; await resolveInvalidatedCookie( boundCallServerEndpoint, dispatchRecoveryAttempt, - source, + logInActionSource, ); return newSessionChange; } diff --git a/lib/utils/config.js b/lib/utils/config.js --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -11,7 +11,7 @@ +resolveInvalidatedCookie: ?( callServerEndpoint: CallServerEndpoint, dispatchRecoveryAttempt: DispatchRecoveryAttempt, - source: LogInActionSource, + logInActionSource: LogInActionSource, ) => Promise, +setCookieOnRequest: boolean, +setSessionIDOnRequest: boolean, 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 @@ -243,7 +243,7 @@ ...extraInfo, username: this.usernameInputText, password: this.passwordInputText, - source: loginActionSources.logInFromNativeForm, + logInActionSource: loginActionSources.logInFromNativeForm, }); this.props.setActiveAlert(false); await setNativeCredentials({ diff --git a/native/account/resolve-invalidated-cookie.js b/native/account/resolve-invalidated-cookie.js --- a/native/account/resolve-invalidated-cookie.js +++ b/native/account/resolve-invalidated-cookie.js @@ -13,7 +13,7 @@ async function resolveInvalidatedCookie( callServerEndpoint: CallServerEndpoint, dispatchRecoveryAttempt: DispatchRecoveryAttempt, - source: LogInActionSource, + logInActionSource: LogInActionSource, ) { const keychainCredentials = await fetchNativeKeychainCredentials(); if (!keychainCredentials) { @@ -29,7 +29,7 @@ logIn(callServerEndpoint)({ ...keychainCredentials, ...extraInfo, - source, + logInActionSource, }), { calendarQuery }, ); 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 @@ -158,13 +158,13 @@ invalidSessionRecovery( state, action.payload.sessionChange.currentUserInfo, - action.payload.source, + action.payload.logInActionSource, )) || (action.type === logInActionTypes.success && invalidSessionRecovery( state, action.payload.currentUserInfo, - action.payload.source, + action.payload.logInActionSource, )) ) { return state; @@ -347,7 +347,7 @@ cookie: state.cookie, }, error: null, - source: loginActionSources.sqliteOpFailure, + logInActionSource: loginActionSources.sqliteOpFailure, }, }); await persistor.flush(); diff --git a/web/account/log-in-form.react.js b/web/account/log-in-form.react.js --- a/web/account/log-in-form.react.js +++ b/web/account/log-in-form.react.js @@ -66,7 +66,7 @@ ...extraInfo, username, password, - source: loginActionSources.logInFromWebForm, + logInActionSource: loginActionSources.logInFromWebForm, }); modalContext.popModal(); return result;