Skip to content

Commit

Permalink
fix(refreshtokens): wrong event name
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Mar 21, 2022
1 parent d920f9f commit f4cf7cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/context/src/oidc/vanilla/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const autoRenewTokensAsync = async (oidc, refreshToken, expiresAt) => {
return timer.setTimeout(async () => {
const currentTimeUnixSecond = new Date().getTime() /1000;
const timeInfo = { timeLeft:((expiresAt - refreshTimeBeforeTokensExpirationInSecond)- currentTimeUnixSecond)};
oidc.publishEvent(Oidc.eventNames.token_renewed, timeInfo);
oidc.publishEvent(Oidc.eventNames.token_timer, timeInfo);
if(currentTimeUnixSecond > (expiresAt - refreshTimeBeforeTokensExpirationInSecond)) {
const tokens = await oidc.refreshTokensAsync(refreshToken);
oidc.tokens= await setTokensAsync(oidc.serviceWorker, tokens);
Expand Down

0 comments on commit f4cf7cc

Please sign in to comment.