This commit is contained in:
Bastian Wagner
2026-07-17 15:34:42 +02:00
parent e89ac1481e
commit 5973658582
16 changed files with 768 additions and 11 deletions

View File

@@ -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);