fix: fix stupid ahh bug where u get logged out when doing fucking anything stupid fucking http interceptor
This commit is contained in:
parent
fb4c7f175a
commit
2c6d5a755f
4 changed files with 15 additions and 15 deletions
|
@ -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) {
|
||||
|
|
Reference in a new issue