diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index 89dd481af5af..af7da709d456 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -568,7 +568,7 @@ function beginGoogleSignIn(token: string | null) { * Will create a temporary login for the user in the passed authenticate response which is used when * re-authenticating after an authToken expires. */ -function signInWithShortLivedAuthToken(email: string, authToken: string) { +function signInWithShortLivedAuthToken(authToken: string) { const {optimisticData, finallyData} = getShortLivedLoginParams(); API.read(READ_COMMANDS.SIGN_IN_WITH_SHORT_LIVED_AUTH_TOKEN, {authToken, skipReauthentication: true}, {optimisticData, finallyData}); } diff --git a/src/pages/LogInWithShortLivedAuthTokenPage.tsx b/src/pages/LogInWithShortLivedAuthTokenPage.tsx index e604f2ccf847..64e4572d4ed2 100644 --- a/src/pages/LogInWithShortLivedAuthTokenPage.tsx +++ b/src/pages/LogInWithShortLivedAuthTokenPage.tsx @@ -17,7 +17,7 @@ import SessionExpiredPage from './ErrorPage/SessionExpiredPage'; type LogInWithShortLivedAuthTokenPageProps = StackScreenProps; function LogInWithShortLivedAuthTokenPage({route}: LogInWithShortLivedAuthTokenPageProps) { - const {email = '', shortLivedAuthToken = '', shortLivedToken = '', authTokenType, exitTo, error} = route?.params ?? {}; + const {shortLivedAuthToken = '', shortLivedToken = '', authTokenType, exitTo, error} = route?.params ?? {}; const [account] = useOnyx(ONYXKEYS.ACCOUNT); useEffect(() => { @@ -37,7 +37,7 @@ function LogInWithShortLivedAuthTokenPage({route}: LogInWithShortLivedAuthTokenP // Try to authenticate using the shortLivedToken if we're not already trying to load the accounts if (token && !account?.isLoading) { Log.info('LogInWithShortLivedAuthTokenPage - Successfully received shortLivedAuthToken. Signing in...'); - Session.signInWithShortLivedAuthToken(email, token); + Session.signInWithShortLivedAuthToken(token); return; } diff --git a/src/pages/LogOutPreviousUserPage.tsx b/src/pages/LogOutPreviousUserPage.tsx index deb95a576c3d..260fe8942926 100644 --- a/src/pages/LogOutPreviousUserPage.tsx +++ b/src/pages/LogOutPreviousUserPage.tsx @@ -61,9 +61,8 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio // On Enabling 2FA, authToken stored in Onyx becomes expired and hence we need to fetch new authToken const shouldForceLogin = route.params.shouldForceLogin === 'true'; if (shouldForceLogin) { - const email = route.params.email ?? ''; const shortLivedAuthToken = route.params.shortLivedAuthToken ?? ''; - SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken); + SessionActions.signInWithShortLivedAuthToken(shortLivedAuthToken); } // We only want to run this effect once on mount (when the page first loads after transitioning from OldDot) // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps diff --git a/src/pages/signin/SAMLSignInPage/index.native.tsx b/src/pages/signin/SAMLSignInPage/index.native.tsx index c6f8b8061c05..9ce73b675320 100644 --- a/src/pages/signin/SAMLSignInPage/index.native.tsx +++ b/src/pages/signin/SAMLSignInPage/index.native.tsx @@ -34,7 +34,7 @@ function SAMLSignInPage({credentials, account}: SAMLSignInPageProps) { const shortLivedAuthToken = searchParams.get('shortLivedAuthToken'); if (!account?.isLoading && credentials?.login && !!shortLivedAuthToken) { Log.info('SAMLSignInPage - Successfully received shortLivedAuthToken. Signing in...'); - Session.signInWithShortLivedAuthToken(credentials.login, shortLivedAuthToken); + Session.signInWithShortLivedAuthToken(shortLivedAuthToken); } // If the login attempt is unsuccessful, set the error message for the account and redirect to sign in page