File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export class OAuthService extends AuthConfig {
74
74
protected _storage : OAuthStorage ;
75
75
protected accessTokenTimeoutSubscription : Subscription ;
76
76
protected idTokenTimeoutSubscription : Subscription ;
77
+ protected tokenReceivedSubscription : Subscription ;
77
78
protected sessionCheckEventListener : EventListener ;
78
79
protected jwksUri : string ;
79
80
protected sessionCheckTimer : any ;
@@ -290,7 +291,10 @@ export class OAuthService extends AuthConfig {
290
291
this . setupExpirationTimers ( ) ;
291
292
}
292
293
293
- this . events . pipe ( filter ( e => e . type === 'token_received' ) ) . subscribe ( _ => {
294
+ if ( this . tokenReceivedSubscription )
295
+ this . tokenReceivedSubscription . unsubscribe ( ) ;
296
+
297
+ this . tokenReceivedSubscription = this . events . pipe ( filter ( e => e . type === 'token_received' ) ) . subscribe ( _ => {
294
298
this . clearAccessTokenTimer ( ) ;
295
299
this . clearIdTokenTimer ( ) ;
296
300
this . setupExpirationTimers ( ) ;
@@ -367,7 +371,7 @@ export class OAuthService extends AuthConfig {
367
371
/**
368
372
* DEPRECATED. Use a provider for OAuthStorage instead:
369
373
*
370
- *
374
+ *
371
375
* { provide: OAuthStorage, useFactory: oAuthStorageFactory }
372
376
* export function oAuthStorageFactory(): OAuthStorage { return localStorage; }
373
377
*
You can’t perform that action at this time.
0 commit comments