File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -144,12 +144,21 @@ export const requestSingleSignOn = async () => {
144
144
// and if feature flag for OIDC Phase 2 is enabled - isAuthEnabled
145
145
// Check if any account or its linked account is missing a token
146
146
147
+ const hasMissingToken = Object . values ( clientAccounts ) . some ( ( account ) => {
148
+ // Check if current account is missing token
149
+ if ( ! account ?. token ) {
150
+ return true ; // No linked accounts and no token
151
+ }
152
+ return false ;
153
+ } ) ;
154
+
147
155
const shouldRequestSignOn =
148
- isLoggedInCookie &&
149
- ! isCallbackPage &&
150
- ! isEndpointPage &&
151
- ( ! isClientAccountsPopulated ) &&
152
- isAuthEnabled ;
156
+ isLoggedInCookie &&
157
+ ! isCallbackPage &&
158
+ ! isEndpointPage &&
159
+ ( ! isClientAccountsPopulated ||
160
+ ( isClientAccountsPopulated && hasMissingToken ) ) &&
161
+ isAuthEnabled ;
153
162
154
163
if ( shouldRequestSignOn ) {
155
164
const currentLanguage = Language . get ( ) ;
You can’t perform that action at this time.
0 commit comments