fix: don't try update if token is not found

This commit is contained in:
Polianin Nikita 2024-08-26 02:12:45 +03:00
parent 8a584fd28a
commit c945a1016b

View File

@ -34,7 +34,7 @@ export class TokenRefreshService {
this.authService.refreshToken() this.authService.refreshToken()
.pipe( .pipe(
catchError(error => { catchError(error => {
if (error.status === 403 || error.status === 401) { if (error.status === 403 || error.status === 401 || !localStorage.getItem(ApiService.tokenKey)) {
localStorage.removeItem(ApiService.tokenKey); localStorage.removeItem(ApiService.tokenKey);
this.refreshTokenExpireMs = -1; this.refreshTokenExpireMs = -1;
return of(undefined); return of(undefined);