Skip to content

Commit

Permalink
fix(oidc): resfreshTokenError not triggered when silentsignin disable…
Browse files Browse the repository at this point in the history
…d (release)
  • Loading branch information
guillaume-chervet committed Feb 11, 2024
1 parent 9ffef5d commit 91b11af
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/oidc-client/src/renewTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,20 @@ const synchroniseTokensAsync = (oidc:Oidc) => async (index = 0, forceRefresh = f
...extras,
prompt: 'none',
});
if (silent_token_response) {
if(silent_token_response.error) {
updateTokens(null);
oidc.publishEvent(eventNames.refreshTokensAsync_error, { message: 'refresh token silent' });
return { tokens: null, status: 'SESSION_LOST' };
}
if (!silent_token_response) {
updateTokens(null);
oidc.publishEvent(eventNames.refreshTokensAsync_error, { message: 'refresh token silent not active' });
return { tokens: null, status: 'SESSION_LOST' };
}
if(silent_token_response.error) {
updateTokens(null);
oidc.publishEvent(eventNames.refreshTokensAsync_error, { message: 'refresh token silent' });
return { tokens: null, status: 'SESSION_LOST' };
}

updateTokens(silent_token_response.tokens);
oidc.publishEvent(Oidc.eventNames.token_renewed, {});
return { tokens: silent_token_response.tokens, status: 'LOGGED' };
}
updateTokens(silent_token_response.tokens);
oidc.publishEvent(Oidc.eventNames.token_renewed, {});
return { tokens: silent_token_response.tokens, status: 'LOGGED' };

} catch (exceptionSilent: any) {
console.error(exceptionSilent);
Expand Down

0 comments on commit 91b11af

Please sign in to comment.