Code cleanup #247
This commit is contained in:
@@ -2,7 +2,7 @@ import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
import { JwtHelperService } from "@auth0/angular-jwt";
|
||||
import { firstValueFrom, Observable, Subject, Subscription } from "rxjs";
|
||||
import { firstValueFrom, Observable, Subject, Subscription, throwError } from "rxjs";
|
||||
import { catchError } from "rxjs/operators";
|
||||
import { AdminUpdateUserDTO } from "src/app/models/auth/admin-update-user.dto";
|
||||
import { AuthRoles } from "src/app/models/auth/auth-roles.enum";
|
||||
@@ -231,7 +231,7 @@ export class AuthService {
|
||||
this.isLoggedIn$.next(false);
|
||||
localStorage.removeItem("rjwt");
|
||||
this.router.navigate(["/auth/login"]);
|
||||
throw error;
|
||||
return throwError(() => error);
|
||||
})).subscribe(() => {
|
||||
this.isLoggedIn$.next(false);
|
||||
localStorage.removeItem("jwt");
|
||||
|
Reference in New Issue
Block a user