1 import { Component } from '@angular/core';
2 import { Router } from '@angular/router';
4 import { I18n } from '@ngx-translate/i18n-polyfill';
6 import { AuthService } from '../../../shared/api/auth.service';
7 import { UserService } from '../../../shared/api/user.service';
8 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
9 import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
10 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
11 import { NotificationService } from '../../../shared/services/notification.service';
12 import { PasswordPolicyService } from '../../../shared/services/password-policy.service';
13 import { UserPasswordFormComponent } from '../user-password-form/user-password-form.component';
16 selector: 'cd-login-password-form',
17 templateUrl: './login-password-form.component.html',
18 styleUrls: ['./login-password-form.component.scss']
20 export class LoginPasswordFormComponent extends UserPasswordFormComponent {
23 public actionLabels: ActionLabelsI18n,
24 public notificationService: NotificationService,
25 public userService: UserService,
26 public authStorageService: AuthStorageService,
27 public formBuilder: CdFormBuilder,
28 public router: Router,
29 public passwordPolicyService: PasswordPolicyService,
30 public authService: AuthService
45 // Logout here because changing the password will change the
46 // session token which will finally lead to a 401 when calling
47 // the REST API the next time. The API HTTP inteceptor will
48 // then also redirect to the login page immediately.
49 this.authService.logout();
53 this.authService.logout();