fix: fix stupid ahh bug where u get logged out when doing fucking anything stupid fucking http interceptor

This commit is contained in:
Constantin Simonis 2025-05-07 14:51:02 +02:00
commit 29a53ea781
No known key found for this signature in database
GPG key ID: 3878FF77C24AF4D2
4 changed files with 15 additions and 15 deletions

View file

@ -1,10 +1,9 @@
import { HttpInterceptorFn } from '@angular/common/http';
import { inject } from '@angular/core';
import { AuthService } from '../../service/auth.service';
const TOKEN_KEY = 'token';
export const httpInterceptor: HttpInterceptorFn = (req, next) => {
const authService = inject(AuthService);
const token = authService.getToken();
const token = localStorage.getItem(TOKEN_KEY);
// Always add CORS headers
if (token) {