Skip to content

Commit

Permalink
fix(silent): when exception on silentsignin (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet authored Mar 24, 2022
1 parent 67b5d24 commit 860e4a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/context/src/oidc/vanilla/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,13 @@ export class Oidc {
return token_response;
} catch(exception) {
console.error(exception);
const silent_token_response =await this.silentSigninAsync();
if(silent_token_response){
return silent_token_response;
try {
const silent_token_response = await this.silentSigninAsync();
if (silent_token_response) {
return silent_token_response;
}
} catch(exceptionSilent) {
console.error(exceptionSilent);
}

this.publishEvent( silentEvent ? eventNames.refreshTokensAsync_silent_error :eventNames.refreshTokensAsync_error, exception);
Expand Down

0 comments on commit 860e4a2

Please sign in to comment.