diff --git a/src/app/interceptors/authentication.interceptor.ts b/src/app/interceptors/authentication.interceptor.ts index 8fddfefae77c8530277f75f39388f393b3751ad0..19a65bb06c9431cf74c7bb391ab121c7d373a6fc 100644 --- a/src/app/interceptors/authentication.interceptor.ts +++ b/src/app/interceptors/authentication.interceptor.ts @@ -14,7 +14,8 @@ import { NotificationService } from '../services/util/notification.service'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; -const AUTH_HEADER_KEY = 'Arsnova-Auth-Token'; +const AUTH_HEADER_KEY = 'Authorization'; +const AUTH_SCHEME = 'Bearer'; @Injectable() export class AuthenticationInterceptor implements HttpInterceptor { @@ -28,7 +29,7 @@ export class AuthenticationInterceptor implements HttpInterceptor { if (this.authenticationService.isLoggedIn()) { const token = this.authenticationService.getToken(); const cloned = req.clone({ - headers: req.headers.set(AUTH_HEADER_KEY, token) + headers: req.headers.set(AUTH_HEADER_KEY, `${AUTH_SCHEME} ${token}`) }); return next.handle(cloned).pipe(tap((event: HttpEvent<any>) => {