Skip to content

Commit

Permalink
chore: added check for endpoint page for silent login
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienne-deriv committed Nov 26, 2024
1 parent 4ad6f8a commit 962e7b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/javascript/_common/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...')
Expand All @@ -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`,
});
Expand Down

0 comments on commit 962e7b9

Please sign in to comment.