From 3187a3300e8689ed8fa12888bc6cfc2228141cf6 Mon Sep 17 00:00:00 2001 From: Alec Rippberger Date: Wed, 25 Sep 2024 15:44:50 -0500 Subject: [PATCH] Consolidate clearing loginEmailService values and routing --- libs/auth/src/angular/login/login.component.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index 9faba5cd1f..4445fc9f4a 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -266,20 +266,18 @@ export class LoginComponent implements OnInit, OnDestroy { // If none of the above cases are true, proceed with login... // ...on Web if (this.clientType === ClientType.Web) { - await this.goAfterLogIn(authResult.userId); - return; - // ...on Browser/Desktop + await this.goAfterLogIn(authResult.userId); } else { - this.loginEmailService.clearValues(); - if (this.clientType === ClientType.Browser) { await this.router.navigate(["/tabs/vault"]); } else { await this.router.navigate(["vault"]); // Desktop } - return; } + + this.loginEmailService.clearValues(); + await this.router.navigate(["vault"]); } protected async launchSsoBrowserWindow(clientId: "browser" | "desktop"): Promise { @@ -312,11 +310,6 @@ export class LoginComponent implements OnInit, OnDestroy { return; } } - - /* TODO-rr-bw: these two lines are also used at the end of the submit method for - Browser/Desktop. See if you can consolidate for all 3 clients. */ - this.loginEmailService.clearValues(); - await this.router.navigate(["vault"]); } protected showCaptcha(): boolean {