1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

setup desktop router

This commit is contained in:
rr-bw
2024-09-09 15:15:57 -07:00
parent bdd6f9f6df
commit 4d1ab66453
3 changed files with 38 additions and 5 deletions

View File

@@ -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,

View File

@@ -508,6 +508,9 @@
"logIn": {
"message": "Log in"
},
"logInToBitwarden": {
"message": "Log in to Bitwarden"
},
"submit": {
"message": "Submit"
},

View File

@@ -162,3 +162,6 @@
<form *ngIf="clientType === ClientType.Browser" [bitSubmit]="submit" [formGroup]="formGroup">
<main tabindex="-1"></main>
</form>
<!-- Desktop Template -->
<form [bitSubmit]="submit" [formGroup]="formGroup">Desktop Template</form>