Skip to content

Commit

Permalink
fix(#38): user is not kicked out if session or token expires and logi…
Browse files Browse the repository at this point in the history
…n is required

Fixes #38
  • Loading branch information
Badisi committed Feb 22, 2024
1 parent 1a1786f commit 2e74b26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/auth-js/oidc/oidc-auth-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class OIDCAuthManager extends AuthManager<OIDCAuthSettings> {
}),
this.userManager.events.addUserUnloaded(() => {
this.user = null;
// If user is kicked out for any reason -> reload the app if login is required
if (this.settings.loginRequired) {
location.reload();
}
}),
this.userManager.events.addSilentRenewError(async () => {
await this.removeUser();
Expand Down

0 comments on commit 2e74b26

Please sign in to comment.