Skip to content

Commit

Permalink
removed unused code from login, 2fa components
Browse files Browse the repository at this point in the history
  • Loading branch information
gbubemismith committed Oct 12, 2023
1 parent 3fbc287 commit 1b6de57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
14 changes: 1 addition & 13 deletions apps/browser/src/auth/popup/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -45,8 +44,7 @@ export class LoginComponent extends BaseLoginComponent {
formBuilder: FormBuilder,
formValidationErrorService: FormValidationErrorsService,
route: ActivatedRoute,
loginService: LoginService,
private routerService: BrowserRouterService
loginService: LoginService
) {
super(
devicesApiService,
Expand All @@ -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) {
Expand Down
12 changes: 0 additions & 12 deletions apps/browser/src/auth/popup/two-factor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions apps/browser/src/popup/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const routes: Routes = [
path: "home",
component: HomeComponent,
canActivate: [UnauthGuard],
data: { state: "home", doNotSaveUrl: true },
data: { state: "home" },
},
{
path: "fido2",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 1b6de57

Please sign in to comment.