From 962e7b91a58df5cfcb75ce35bb93911f351a0c8d Mon Sep 17 00:00:00 2001 From: Adrienne Rio Date: Tue, 26 Nov 2024 17:25:37 +0800 Subject: [PATCH] chore: added check for endpoint page for silent login --- src/javascript/_common/auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/javascript/_common/auth.js b/src/javascript/_common/auth.js index a4896f22f7c..0b45d552b99 100644 --- a/src/javascript/_common/auth.js +++ b/src/javascript/_common/auth.js @@ -159,6 +159,7 @@ export const requestSingleSignOn = async () => { const isClientAccountsPopulated = Object.keys(clientAccounts).length > 0; const isAuthEnabled = isOAuth2Enabled(); const isCallbackPage = window.location.pathname.includes('callback'); + const isEndpointPage = window.location.pathname.includes('endpoint'); // eslint-disable-next-line console.log('requesting single-sign-on...') @@ -170,7 +171,7 @@ export const requestSingleSignOn = async () => { // if we are not in the callback route to prevent re-calling this function - !isCallbackPage // if client.accounts in localStorage is empty - !isClientAccountsPopulated // and if feature flag for OIDC Phase 2 is enabled - isAuthEnabled - if (isLoggedInCookie && !isCallbackPage && !isClientAccountsPopulated && isAuthEnabled) { + if (isLoggedInCookie && !isCallbackPage && !isEndpointPage && !isClientAccountsPopulated && isAuthEnabled) { await requestOidcAuthentication({ redirectCallbackUri: `${window.location.origin}/en/callback`, });