From 4d1ab66453b163fd59474494cf3fb42a1fbf7bf3 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:15:57 -0700 Subject: [PATCH] setup desktop router --- apps/desktop/src/app/app-routing.module.ts | 37 ++++++++++++++++--- apps/desktop/src/locales/en/messages.json | 3 ++ .../src/angular/login/login.component.html | 3 ++ 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/app/app-routing.module.ts b/apps/desktop/src/app/app-routing.module.ts index 2376eb3844b..6c7932c9cab 100644 --- a/apps/desktop/src/app/app-routing.module.ts +++ b/apps/desktop/src/app/app-routing.module.ts @@ -1,6 +1,8 @@ import { NgModule } from "@angular/core"; import { RouterModule, Routes } from "@angular/router"; +import { EnvironmentSelectorComponent } from "@bitwarden/angular/auth/components/environment-selector.component"; +import { unauthUiRefreshSwap } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-route-swap"; import { authGuard, lockGuard, @@ -12,6 +14,7 @@ import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag import { AnonLayoutWrapperComponent, AnonLayoutWrapperData, + LoginComponentV2, RegistrationFinishComponent, RegistrationStartComponent, RegistrationStartSecondaryComponent, @@ -51,11 +54,6 @@ const routes: Routes = [ component: LockComponent, canActivate: [lockGuard()], }, - { - path: "login", - component: LoginComponent, - canActivate: [maxAccountsGuardFn()], - }, { path: "login-with-device", component: LoginViaAuthRequestComponent, @@ -113,6 +111,35 @@ const routes: Routes = [ canActivate: [authGuard], data: { titleId: "removeMasterPassword" }, }, + ...unauthUiRefreshSwap( + LoginComponent, + AnonLayoutWrapperComponent, + { + path: "login", + component: LoginComponent, + canActivate: [maxAccountsGuardFn()], + }, + { + path: "", + children: [ + { + path: "login", + canActivate: [maxAccountsGuardFn()], + data: { + pageTitle: "logInToBitwarden", + }, + children: [ + { path: "", component: LoginComponentV2 }, + { + path: "", + component: EnvironmentSelectorComponent, + outlet: "environment-selector", + }, + ], + }, + ], + }, + ), { path: "", component: AnonLayoutWrapperComponent, diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index 5345c6e15a3..b54cf39281a 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -508,6 +508,9 @@ "logIn": { "message": "Log in" }, + "logInToBitwarden": { + "message": "Log in to Bitwarden" + }, "submit": { "message": "Submit" }, diff --git a/libs/auth/src/angular/login/login.component.html b/libs/auth/src/angular/login/login.component.html index b1b60e24daa..62bb573ad3c 100644 --- a/libs/auth/src/angular/login/login.component.html +++ b/libs/auth/src/angular/login/login.component.html @@ -162,3 +162,6 @@
+ + +
Desktop Template