diff --git a/support-portal-frontend/src/app/component/login/login.component.ts b/support-portal-frontend/src/app/component/login/login.component.ts index 15b7777..a47d40d 100644 --- a/support-portal-frontend/src/app/component/login/login.component.ts +++ b/support-portal-frontend/src/app/component/login/login.component.ts @@ -7,6 +7,7 @@ import {Subscription} from "rxjs"; import {UserLogin} from "../../dto/user-login"; import {HttpErrorResponse, HttpResponse} from "@angular/common/http"; import {User} from "../../model/user"; +import {HeaderType} from "../../enum/header-type.enum"; @Component({ selector: 'app-login', @@ -39,7 +40,7 @@ export class LoginComponent implements OnInit, OnDestroy { .login(userLogin) .subscribe((response: HttpResponse) => { - const token = response.headers.get("Jwt-Token"); + const token = response.headers.get(HeaderType.JWT_TOKEN); this.authenticationService.saveToken(token!); this.authenticationService.addUserToLocalStorage(response.body!); diff --git a/support-portal-frontend/src/app/enum/header-type.enum.ts b/support-portal-frontend/src/app/enum/header-type.enum.ts new file mode 100644 index 0000000..425d153 --- /dev/null +++ b/support-portal-frontend/src/app/enum/header-type.enum.ts @@ -0,0 +1,4 @@ +export enum HeaderType { + AUTHORIZATION = 'Authorization', + JWT_TOKEN = 'Jwt-Token' +}