From e7fcf97a94ddca7e056703e94f8785f867a9ee20 Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Thu, 12 Oct 2023 14:53:13 -0400 Subject: [PATCH] removed unused code from login, 2fa components (#6565) --- apps/browser/src/auth/popup/login.component.ts | 14 +------------- .../browser/src/auth/popup/two-factor.component.ts | 12 ------------ apps/browser/src/popup/app-routing.module.ts | 8 ++++---- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/apps/browser/src/auth/popup/login.component.ts b/apps/browser/src/auth/popup/login.component.ts index 2dc997e657b..2b5b2cb5e87 100644 --- a/apps/browser/src/auth/popup/login.component.ts +++ b/apps/browser/src/auth/popup/login.component.ts @@ -19,7 +19,6 @@ import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/ge import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { flagEnabled } from "../../platform/flags"; -import { BrowserRouterService } from "../../platform/popup/services/browser-router.service"; @Component({ selector: "app-login", @@ -45,8 +44,7 @@ export class LoginComponent extends BaseLoginComponent { formBuilder: FormBuilder, formValidationErrorService: FormValidationErrorsService, route: ActivatedRoute, - loginService: LoginService, - private routerService: BrowserRouterService + loginService: LoginService ) { super( devicesApiService, @@ -72,16 +70,6 @@ export class LoginComponent extends BaseLoginComponent { super.successRoute = "/tabs/vault"; - super.onSuccessfulLoginNavigate = async () => { - const previousUrl = this.routerService.getPreviousUrl(); - - if (previousUrl) { - this.router.navigateByUrl(previousUrl); - } else { - this.router.navigate([this.successRoute]); - } - }; - this.showPasswordless = flagEnabled("showPasswordless"); if (this.showPasswordless) { diff --git a/apps/browser/src/auth/popup/two-factor.component.ts b/apps/browser/src/auth/popup/two-factor.component.ts index f4d09aa26ec..90e6cf20678 100644 --- a/apps/browser/src/auth/popup/two-factor.component.ts +++ b/apps/browser/src/auth/popup/two-factor.component.ts @@ -22,7 +22,6 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv import { DialogService } from "@bitwarden/components"; import { BrowserApi } from "../../platform/browser/browser-api"; -import { BrowserRouterService } from "../../platform/popup/services/browser-router.service"; import { PopupUtilsService } from "../../popup/services/popup-utils.service"; const BroadcasterSubscriptionId = "TwoFactorComponent"; @@ -53,7 +52,6 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { loginService: LoginService, configService: ConfigServiceAbstraction, private dialogService: DialogService, - private routerService: BrowserRouterService, @Inject(WINDOW) protected win: Window ) { super( @@ -86,16 +84,6 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { super.successRoute = "/tabs/vault"; - super.onSuccessfulLoginNavigate = async () => { - const previousUrl = this.routerService.getPreviousUrl(); - - if (previousUrl) { - this.router.navigateByUrl(previousUrl); - } else { - this.router.navigate([this.successRoute]); - } - }; - // FIXME: Chromium 110 has broken WebAuthn support in extensions via an iframe this.webAuthnNewTab = true; } diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index 5f20ca53521..10159a715f0 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -73,7 +73,7 @@ const routes: Routes = [ path: "home", component: HomeComponent, canActivate: [UnauthGuard], - data: { state: "home", doNotSaveUrl: true }, + data: { state: "home" }, }, { path: "fido2", @@ -85,7 +85,7 @@ const routes: Routes = [ path: "login", component: LoginComponent, canActivate: [UnauthGuard], - data: { state: "login", doNotSaveUrl: true }, + data: { state: "login" }, }, { path: "login-with-device", @@ -109,13 +109,13 @@ const routes: Routes = [ path: "2fa", component: TwoFactorComponent, canActivate: [UnauthGuard], - data: { state: "2fa", doNotSaveUrl: true }, + data: { state: "2fa" }, }, { path: "2fa-options", component: TwoFactorOptionsComponent, canActivate: [UnauthGuard], - data: { state: "2fa-options", doNotSaveUrl: true }, + data: { state: "2fa-options" }, }, { path: "login-initiated",