From 79e89c223884c141f3c624d8971def232466ce0b Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Thu, 16 Nov 2023 18:15:06 -0800 Subject: [PATCH] return early when we've already initiated saml login --- src/pages/signin/SAMLSignInPage/index.native.js | 2 +- src/pages/signin/SignInPage.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/signin/SAMLSignInPage/index.native.js b/src/pages/signin/SAMLSignInPage/index.native.js index b1e67ef4d14a..094592e681d4 100644 --- a/src/pages/signin/SAMLSignInPage/index.native.js +++ b/src/pages/signin/SAMLSignInPage/index.native.js @@ -48,7 +48,7 @@ function SAMLSignInPage({credentials}) { } // If the login attempt is unsuccessful, set the error message for the account and redirect to sign in page - if (searchParams.has('error')) {; + if (searchParams.has('error')) { Session.setAccountError(searchParams.get('error')); Navigation.navigate(ROUTES.HOME); } diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index 68c793e49dad..ce70e548dfe3 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -192,6 +192,9 @@ function SignInPage({credentials, account, isInModal, activeClients, preferredLo if (shouldInitiateSAMLLogin) { setHasInitiatedSAMLLogin(true); Navigation.isNavigationReady().then(() => Navigation.navigate(ROUTES.SAML_SIGN_IN)); + } else if (hasInitiatedSAMLLogin) { + // Return early because we're already navigating to a different page + return; } let welcomeHeader = '';