diff --git a/apps/browser/src/auth/popup/register.component.ts b/apps/browser/src/auth/popup/register.component.ts index a46e44ab7d..dab1e62f85 100644 --- a/apps/browser/src/auth/popup/register.component.ts +++ b/apps/browser/src/auth/popup/register.component.ts @@ -4,7 +4,7 @@ import { Router } from "@angular/router"; import { RegisterComponent as BaseRegisterComponent } from "@bitwarden/angular/auth/components/register.component"; import { FormValidationErrorsService } from "@bitwarden/angular/platform/abstractions/form-validation-errors.service"; -import { LoginEmailService, LoginStrategyServiceAbstraction } from "@bitwarden/auth/common"; +import { LoginStrategyServiceAbstraction } from "@bitwarden/auth/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; @@ -40,7 +40,6 @@ export class RegisterComponent extends BaseRegisterComponent { auditService: AuditService, dialogService: DialogService, toastService: ToastService, - loginEmailService: LoginEmailService, ) { super( formValidationErrorService, @@ -58,7 +57,6 @@ export class RegisterComponent extends BaseRegisterComponent { auditService, dialogService, toastService, - loginEmailService, ); } } diff --git a/apps/web/src/app/auth/register-form/register-form.component.ts b/apps/web/src/app/auth/register-form/register-form.component.ts index 60aa03465c..d9bc32f06b 100644 --- a/apps/web/src/app/auth/register-form/register-form.component.ts +++ b/apps/web/src/app/auth/register-form/register-form.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit, OnDestroy } from "@angular/core"; +import { Component, Input, OnInit } from "@angular/core"; import { UntypedFormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; @@ -27,7 +27,7 @@ import { AcceptOrganizationInviteService } from "../organization-invite/accept-o selector: "app-register-form", templateUrl: "./register-form.component.html", }) -export class RegisterFormComponent extends BaseRegisterComponent implements OnInit, OnDestroy { +export class RegisterFormComponent extends BaseRegisterComponent implements OnInit { @Input() queryParamEmail: string; @Input() queryParamFromOrgInvite: boolean; @Input() enforcedPolicyOptions: MasterPasswordPolicyOptions; diff --git a/libs/angular/src/auth/components/register.component.ts b/libs/angular/src/auth/components/register.component.ts index a11d9d887c..ea48d55ca2 100644 --- a/libs/angular/src/auth/components/register.component.ts +++ b/libs/angular/src/auth/components/register.component.ts @@ -1,7 +1,6 @@ -import { Directive, EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core"; +import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { AbstractControl, UntypedFormBuilder, ValidatorFn, Validators } from "@angular/forms"; import { Router } from "@angular/router"; -import { Subject, takeUntil } from "rxjs"; import { LoginEmailService, @@ -35,7 +34,7 @@ import { InputsFieldMatch } from "../validators/inputs-field-match.validator"; import { CaptchaProtectedComponent } from "./captcha-protected.component"; @Directive() -export class RegisterComponent extends CaptchaProtectedComponent implements OnInit, OnDestroy { +export class RegisterComponent extends CaptchaProtectedComponent implements OnInit { @Input() isInTrialFlow = false; @Output() createdAccount = new EventEmitter(); @@ -83,8 +82,6 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn protected captchaBypassToken: string = null; - protected destroy$ = new Subject(); - // allows for extending classes to modify the register request before sending // allows for extending classes to modify the register request before sending // currently used by web to add organization invitation details @@ -117,20 +114,6 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setupCaptcha(); - - /** - * If the user has a login email, set the email field to the login email. - */ - this.loginEmailService.loginEmail$.pipe(takeUntil(this.destroy$)).subscribe((email) => { - if (email) { - this.formGroup.patchValue({ email }); - } - }); - } - - ngOnDestroy() { - this.destroy$.next(); - this.destroy$.complete(); } async submit(showToast = true) {