1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-04-14 20:07:04 +02:00

Fixed destroy subject inheritance issue on the login componenet

This commit is contained in:
gbubemismith 2023-08-23 14:33:34 -04:00
parent c06e1cff68
commit 036c142a8d
No known key found for this signature in database
2 changed files with 9 additions and 10 deletions

View File

@ -1,7 +1,7 @@
import { Component, NgZone, OnDestroy, OnInit } from "@angular/core";
import { Component, NgZone, OnInit } from "@angular/core";
import { FormBuilder } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Subject, takeUntil } from "rxjs";
import { takeUntil } from "rxjs";
import { first } from "rxjs/operators";
import { LoginComponent as BaseLoginComponent } from "@bitwarden/angular/auth/components/login.component";
@ -33,14 +33,13 @@ import { RouterService, StateService } from "../../core";
selector: "app-login",
templateUrl: "login.component.html",
})
export class LoginComponent extends BaseLoginComponent implements OnInit, OnDestroy {
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
export class LoginComponent extends BaseLoginComponent implements OnInit {
showResetPasswordAutoEnrollWarning = false;
enforcedPasswordPolicyOptions: MasterPasswordPolicyOptions;
policies: ListResponse<PolicyResponse>;
showPasswordless = false;
private destroy$ = new Subject<void>();
constructor(
devicesApiService: DevicesApiServiceAbstraction,
appIdService: AppIdService,
@ -145,9 +144,9 @@ export class LoginComponent extends BaseLoginComponent implements OnInit, OnDest
}
}
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
super.ngOnDestroy();
}
async goAfterLogIn() {

View File

@ -1,4 +1,4 @@
import { Directive, ElementRef, NgZone, OnInit, ViewChild } from "@angular/core";
import { Directive, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from "@angular/core";
import { FormBuilder, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Subject } from "rxjs";
@ -28,7 +28,7 @@ import {
import { CaptchaProtectedComponent } from "./captcha-protected.component";
@Directive()
export class LoginComponent extends CaptchaProtectedComponent implements OnInit {
export class LoginComponent extends CaptchaProtectedComponent implements OnInit, OnDestroy {
@ViewChild("masterPasswordInput", { static: true }) masterPasswordInput: ElementRef;
showPassword = false;
@ -52,7 +52,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
protected successRoute = "vault";
protected forcePasswordResetRoute = "update-temp-password";
private destroy$ = new Subject<void>();
protected destroy$ = new Subject<void>();
get loggedEmail() {
return this.formGroup.value.email;