logging
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Inject, Injectable, signal } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { tap } from 'rxjs';
|
||||
import { catchError, EMPTY, tap } from 'rxjs';
|
||||
import { API_BASE_URL } from './api-base-url';
|
||||
|
||||
interface LoginResponse {
|
||||
@@ -34,6 +34,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
this.http.post<void>(`${this.apiBaseUrl}/auth/logout`, {}).pipe(catchError(() => EMPTY)).subscribe();
|
||||
localStorage.removeItem('accessToken');
|
||||
localStorage.removeItem('username');
|
||||
this.username.set(null);
|
||||
|
||||
Reference in New Issue
Block a user