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