wip
This commit is contained in:
parent
33683f565f
commit
f547d05f64
8 changed files with 78 additions and 104 deletions
9
frontend/src/app/shared/interceptor/http.interceptor.ts
Normal file
9
frontend/src/app/shared/interceptor/http.interceptor.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { HttpInterceptorFn } from '@angular/common/http';
|
||||
import { inject } from '@angular/core';
|
||||
import { AuthService } from '../../service/auth.service';
|
||||
|
||||
export const httpInterceptor: HttpInterceptorFn = (req, next) => {
|
||||
return next(req.clone({
|
||||
setHeaders: {'Authorization': 'Bearer '+inject(AuthService).getAccessToken()},
|
||||
}));
|
||||
};
|
Reference in a new issue