We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9fa6e4 commit 6217f40Copy full SHA for 6217f40
1 file changed
src/app/authentication/interceptor/authentication.interceptor.ts
@@ -12,11 +12,16 @@ export class AuthenticationInterceptor implements HttpInterceptor {
12
constructor(private authenticationService: AuthenticationService) { }
13
14
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
15
- let authReq = req;
+ let authReq;
16
+
17
const token = this.authenticationService.getToken();
- if (token != null) {
18
- authReq = req.clone({ headers: req.headers.set(this.tokenHeaderKey, 'Bearer ' + token) });
19
+ if (token === null) {
20
+ authReq = req;
21
+ } else {
22
+ authReq = req.clone({ headers: req.headers.set(this.tokenHeaderKey, 'Basic ' + token) });
23
}
24
25
return next.handle(authReq);
26
27
0 commit comments