Skip to content

Commit 8ab853b

Browse files
committed
feat(automatic silent refresh): stopAutomaticRefresh stops all timers.
To restart them, call setupAutomaticSilentRefresh again.
1 parent 0d15d6a commit 8ab853b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

projects/lib/src/auth.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class AuthConfig {
217217
public nonceStateSeparator? = ';';
218218

219219
/**
220-
* Set this to true to use HTTP BASIC auth for password flow
220+
* Set this to true to use HTTP BASIC auth for AJAX calls
221221
*/
222222
public useHttpBasicAuth? = false;
223223

projects/lib/src/oauth-service.ts

+9
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,15 @@ export class OAuthService extends AuthConfig implements OnDestroy {
427427
});
428428
}
429429

430+
/**
431+
* Stops timers for automatic refresh.
432+
* To restart it, call setupAutomaticSilentRefresh again.
433+
*/
434+
public stopAutomaticRefresh() {
435+
this.clearAccessTokenTimer();
436+
this.clearIdTokenTimer();
437+
}
438+
430439
protected clearAccessTokenTimer(): void {
431440
if (this.accessTokenTimeoutSubscription) {
432441
this.accessTokenTimeoutSubscription.unsubscribe();

0 commit comments

Comments
 (0)