Début du login + parametres

This commit is contained in:
2026-06-10 11:49:23 +02:00
parent 1cc9688d00
commit b85d09ee55
25 changed files with 464 additions and 221 deletions
+15
View File
@@ -0,0 +1,15 @@
import { HttpInterceptorFn } from '@angular/common/http';
import { inject } from '@angular/core';
import {AuthService} from "./auth.service";
export const authInterceptor: HttpInterceptorFn = (req, next) => {
const token = inject(AuthService).getToken();
if (token) {
req = req.clone({
setHeaders: { Authorization: `Bearer ${token}` }
});
}
return next(req);
};