Browse Source

redirect to the login page when token expired

pull/10571/head
mehmet-erim 5 years ago
parent
commit
86b8f952ee
  1. 5
      npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts

5
npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts

@ -60,6 +60,11 @@ export abstract class AuthFlowStrategy {
if (shouldClear) clearOAuthStorage(oAuthStorage); if (shouldClear) clearOAuthStorage(oAuthStorage);
this.oAuthService.configure(this.oAuthConfig); this.oAuthService.configure(this.oAuthConfig);
this.oAuthService.events
.pipe(filter(event => event.type === 'token_refresh_error'))
.subscribe(() => this.navigateToLogin());
return this.oAuthService return this.oAuthService
.loadDiscoveryDocument() .loadDiscoveryDocument()
.then(() => { .then(() => {

Loading…
Cancel
Save