Skip to content

Commit 2e3c617

Browse files
Harm PauwHarm Pauw
Harm Pauw
authored and
Harm Pauw
committed
Always set expiration timers for valid token types
Instead of only setting a token expiration timer for the shortest living token type, set timers for both token types as long as they are valid.
1 parent a1652dc commit 2e3c617

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

projects/lib/src/oauth-service.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,11 @@ export class OAuthService extends AuthConfig implements OnDestroy {
312312
}
313313

314314
protected setupExpirationTimers(): void {
315-
const idTokenExp = this.getIdTokenExpiration() || Number.MAX_VALUE;
316-
const accessTokenExp = this.getAccessTokenExpiration() || Number.MAX_VALUE;
317-
const useAccessTokenExp = accessTokenExp <= idTokenExp;
318-
319-
if (this.hasValidAccessToken() && useAccessTokenExp) {
315+
if (this.hasValidAccessToken()) {
320316
this.setupAccessTokenTimer();
321317
}
322318

323-
if (this.hasValidIdToken() && !useAccessTokenExp) {
319+
if (this.hasValidIdToken()) {
324320
this.setupIdTokenTimer();
325321
}
326322
}

0 commit comments

Comments
 (0)