diff --git a/src/app/authentication.interceptor.ts b/src/app/authentication.interceptor.ts index 57b5abb586a5667cf0dc23dfd536193d842e3d5b..1185fe4a00749c227b55f2d5313e1ec8d1b331a2 100644 --- a/src/app/authentication.interceptor.ts +++ b/src/app/authentication.interceptor.ts @@ -17,9 +17,8 @@ export class AuthenticationInterceptor implements HttpInterceptor { } intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { - const token = this.authenticationService.getUser().token; - - if (token) { + if (this.authenticationService.isLoggedIn()) { + const token = this.authenticationService.getToken(); const cloned = req.clone({ headers: req.headers.set(AUTH_HEADER_KEY, token) });