fix: remove double start token refresh
This commit is contained in:
		| @@ -19,9 +19,6 @@ export class TokenRefreshService { | ||||
|   private startTokenRefresh(): void { | ||||
|     this.refreshTokenTimeout = setTimeout(() => { | ||||
|       this.refreshToken(); | ||||
|  | ||||
|       if (this.refreshTokenExpireMs > 0) | ||||
|         this.startTokenRefresh(); | ||||
|     }, this.refreshTokenExpireMs); | ||||
|   } | ||||
|  | ||||
| @@ -36,7 +33,6 @@ export class TokenRefreshService { | ||||
|         catchError(error => { | ||||
|           if (error.status === 403 || error.status === 401 || !localStorage.getItem(ApiService.tokenKey)) { | ||||
|             localStorage.removeItem(ApiService.tokenKey); | ||||
|             this.refreshTokenExpireMs = -1; | ||||
|             return of(undefined); | ||||
|           } | ||||
|  | ||||
| @@ -56,6 +52,7 @@ export class TokenRefreshService { | ||||
|       .subscribe(data => { | ||||
|         if (data) | ||||
|           this.setRefreshTokenExpireMs(data); | ||||
|  | ||||
|         this.tokenRefreshing$.next(false); | ||||
|       }); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user