mirror of
https://github.com/bitwarden/browser
synced 2025-12-31 23:53:37 +00:00
* PM-9449 - Init stub of new lock comp * PM-9449 - (1) Add new lock screen title to all clients (2) Add to temp web routing module config * PM-9449 - LockV2Comp - Building now with web HTML * PM-9449 - Libs/Auth LockComp - bring in all desktop ts code; WIP, need to stand up LockCompService to facilitate ipc communication. * PM-9449 - Create LockComponentService for facilitating client logic; potentially will decompose later. * PM-9449 - Add extension lock comp service. * PM-9449 - Libs/auth LockComp - bring in browser extension logic * PM-9449 - Libs/auth LockComp html start * PM-9449 - Libs/Auth LockComp - (1) Remove unused dep (2) Update setEmailAsPageSubtitle to work. * PM-9449 - Add getBiometricsError to lock comp service for extension. * PM-9449 - LockComp - (1) Save off client type as public comp var (2) Rename biometricLock as biometricLockSet * PM-9449 - Work on lock comp service getAvailableUnlockOptions * PM-9449 - WIP libs/auth LockComp * PM-9449 - (1) Remove default lock comp svc (2) Add web lock comp svc. * PM-9449 - UnlockOptions - replace incorrect type * PM-9449 - DesktopLockComponentService -get most of observable based getAvailableUnlockOptions$ logic in place. * PM-9449 - LockCompSvc - getAvailableUnlockOptions in place for all clients. * PM-9449 - Add getBiometricsUnlockBtnText to LockCompSvc and put TODO for wiring it up later * PM-9449 - Lock Comp - Replace all manual bools with unlock options. * PM-9449 - Desktop Lock Comp Svc - adjust spacing * PM-9449 - LockCompSvc - remove biometricsEnabled method * PM-9449 - LockComp - Clean up commented out code * PM-9449 - LockComp - webVaultHostname --> envHostName * PM-9449 - Fix lock comp svc deps * PM-9449 - LockComp - HTML progress * PM-9449 - LockComp cleanup * PM-9449 - Web Routing Module - wire up lock vs lockv2 using extension swap * PM-9449 - Wire up loading state * PM-9449 - LockComp - start wiring up listenForActiveUnlockOptionChanges logic with reactivity * PM-9449 - Update desktop & extension lock comp service to use new biometrics service vs platform utils for biometrics information. * PM-9449 - LockV2 - Swap platform util usage with toast svc * PM-9449 - LockV2Comp - Bring over user id logic from PM-8933 * PM-9449 - LockV2Comp - Adjust everything to use activeAccount.id. * PM-9449 - LockV2Comp - Progress on wiring up unlock option reactive stream. * PM-9449 - LockComp ts - some refactoring and minor progress. * PM-9449 - LockComp HTML - refactoring based on new idea to keep unlock options as separate as possible. * PM-9449 - Add PIN translation to web * PM-9449 - (1) Lock HTML refactor to make as independent verticals as possible (2) Refactor Lock ts (3) LockSvc - replace type with enum. * PM-9449 - LockV2Comp - remove hardcoded await. * PM-9449 - LockComp HTML - add todo * PM-9449 - Web - Routing module - cleanup commented out stuff * PM-9449 - LockV2Comp - Wire up biometrics + mild refactor. * PM-9449 - Desktop - Wire up lockV2 redirection * PM-9449 - LockV2 - Desktop - don't focus until unlock opts defined. * PM-9449 - Fix accidental check in * PM-9449 - LockV2 - loading state depends on unlock opts * PM-9449 - LockV2 comp - remove unnecessary hr * PM-9449 - Migrate "yourVaultIsLockedV2" translation to desktop & browser. * PM-9449 - LockV2 - Layout tweaks for biometrics * PM-9449 - LockV2 - Biometric btn text * PM-9449 - LockV2 - Wire up biometrics loading / disable state + remove unnecessary conditions around biometricsUnlockBtnText * PM-9449 - DesktopLockSvc - Per discussion with Bernd, remove interval polling and just check once for biometric support and availability. * PM-9449 - AuthGuard - Add todo to remove promptBiometric * PM-9449 - LockV2 - Refactor primary and desktop init logic + misc clean up * PM-9449 - LockV2 - Reorder init methods * PM-9449 - LockV2 - Per discussion with Product, deprecate windows biometric settings update warning * PM-9449 - Add TODO per discussion with Justin and remove TODO * PM-9449 - LockV2 - Restore hide password on desktop window hidden functionality. * PM-9449 - Clean up accomplished todo * PM-9449 - LockV2 - Refactor func name. * PM-9449 - LockV2 Comp - (1) TODO cleanup (2) Add browser logic to handleBiometricsUnlockEnabled * PM-9449 - LockCompSvc changes - (1) Observability for isFido2Session (2) Adjust errors and returns per discussion with Justin * PM-9449 - Per product, no longer need to support special fido2 case on extension. * PM-9449 - LockCompSvc - add getPreviousUrl support * PM-9449 - LockV2 - Continued ts cleanup * PM-9449 - LockV2Comp - clean up unused props * PM-9449 - LockV2Comp - Rename response to masterPasswordVerificationResponse * PM-9449 - LockV2 - Remove unused formPromise prop * PM-9449 - Add missing translations + update desktop to showReadonlyHostName * PM-9449 - LockV2 - cleanup TODO * PM-9449 - LockV2 - more cleanup * PM-9449 - Desktop Routing Module - only allow LockV2 access if extension refresh flag is enabled. * PM-9449 - Extension - AppRoutingModule - Add extension redirect + new lockV2 route. * PM-9449 - Extension - AppRoutingModule - Add lockV2 to the ExtensionAnonLayoutWrapperComponent intead of the regular one. * PM-9449 - Extension - CurrentAccountComp - add null checks as anon layout components don't have a state today. This prevents the account switcher from working on the new lockV2 comp. * PM-9449 - Extension AppRoutingModule - LockV2 should use ExtensionAnonLayoutWrapperData * PM-9449 - LockComp - BiometricUnlock - cancelling is a valid action. * PM-9449 - LockV2 - Biometric autoprompt cleanup * PM-9449 - LockV2 - (1) Add TODO for KM team (2) Fix submit logic. * PM-9449 - Tweak TODO to add task # * PM-9449 - Test WebLockComponentService * PM-9449 - ExtensionLockComponentService tested * PM-9449 - Tweak extension lock comp svc test * PM-9449 - DesktopLockComponentService tested * PM-9449 - Add task # to TODO * PM-9449 - Update apps/browser/src/services/extension-lock-component.service.ts per PR feedback Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com> * PM-9449 - Per PR feedback, replace from with defer for better reactive execution of promise based functions. * PM-9449 - Per PR feedback replace enum with type. * PM-9449 - Fix imports and tests due to key management file moves. * PM-9449 - Another test file import fix --------- Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
235 lines
7.1 KiB
TypeScript
235 lines
7.1 KiB
TypeScript
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,
|
|
redirectGuard,
|
|
tdeDecryptionRequiredGuard,
|
|
unauthGuardFn,
|
|
} from "@bitwarden/angular/auth/guards";
|
|
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
|
|
import { extensionRefreshRedirect } from "@bitwarden/angular/utils/extension-refresh-redirect";
|
|
import {
|
|
AnonLayoutWrapperComponent,
|
|
AnonLayoutWrapperData,
|
|
LockIcon,
|
|
LockV2Component,
|
|
PasswordHintComponent,
|
|
RegistrationFinishComponent,
|
|
RegistrationStartComponent,
|
|
RegistrationStartSecondaryComponent,
|
|
RegistrationStartSecondaryComponentData,
|
|
SetPasswordJitComponent,
|
|
UserLockIcon,
|
|
} from "@bitwarden/auth/angular";
|
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
|
|
import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
|
|
import { AccessibilityCookieComponent } from "../auth/accessibility-cookie.component";
|
|
import { maxAccountsGuardFn } from "../auth/guards/max-accounts.guard";
|
|
import { HintComponent } from "../auth/hint.component";
|
|
import { LockComponent } from "../auth/lock.component";
|
|
import { LoginDecryptionOptionsComponent } from "../auth/login/login-decryption-options/login-decryption-options.component";
|
|
import { LoginViaAuthRequestComponent } from "../auth/login/login-via-auth-request.component";
|
|
import { LoginComponent } from "../auth/login/login.component";
|
|
import { RegisterComponent } from "../auth/register.component";
|
|
import { RemovePasswordComponent } from "../auth/remove-password.component";
|
|
import { SetPasswordComponent } from "../auth/set-password.component";
|
|
import { SsoComponent } from "../auth/sso.component";
|
|
import { TwoFactorAuthComponent } from "../auth/two-factor-auth.component";
|
|
import { TwoFactorComponent } from "../auth/two-factor.component";
|
|
import { UpdateTempPasswordComponent } from "../auth/update-temp-password.component";
|
|
import { VaultComponent } from "../vault/app/vault/vault.component";
|
|
|
|
import { SendComponent } from "./tools/send/send.component";
|
|
|
|
/**
|
|
* Data properties acceptable for use in route objects in the desktop
|
|
*/
|
|
export interface RouteDataProperties {
|
|
// For any new route data properties, add them here.
|
|
// then assert that the data object satisfies this interface in the route object.
|
|
}
|
|
|
|
const routes: Routes = [
|
|
{
|
|
path: "",
|
|
pathMatch: "full",
|
|
children: [], // Children lets us have an empty component.
|
|
canActivate: [redirectGuard({ loggedIn: "/vault", loggedOut: "/login", locked: "/lock" })],
|
|
},
|
|
{
|
|
path: "lock",
|
|
component: LockComponent,
|
|
canActivate: [lockGuard()],
|
|
canMatch: [extensionRefreshRedirect("/lockV2")],
|
|
},
|
|
{
|
|
path: "login",
|
|
component: LoginComponent,
|
|
canActivate: [maxAccountsGuardFn()],
|
|
},
|
|
{
|
|
path: "login-with-device",
|
|
component: LoginViaAuthRequestComponent,
|
|
},
|
|
{
|
|
path: "admin-approval-requested",
|
|
component: LoginViaAuthRequestComponent,
|
|
},
|
|
...twofactorRefactorSwap(
|
|
TwoFactorComponent,
|
|
AnonLayoutWrapperComponent,
|
|
{
|
|
path: "2fa",
|
|
},
|
|
{
|
|
path: "2fa",
|
|
component: AnonLayoutWrapperComponent,
|
|
children: [
|
|
{
|
|
path: "",
|
|
component: TwoFactorAuthComponent,
|
|
canActivate: [unauthGuardFn()],
|
|
},
|
|
],
|
|
},
|
|
),
|
|
{
|
|
path: "login-initiated",
|
|
component: LoginDecryptionOptionsComponent,
|
|
canActivate: [tdeDecryptionRequiredGuard()],
|
|
},
|
|
{ path: "register", component: RegisterComponent },
|
|
{
|
|
path: "vault",
|
|
component: VaultComponent,
|
|
canActivate: [authGuard],
|
|
},
|
|
{ path: "accessibility-cookie", component: AccessibilityCookieComponent },
|
|
{ path: "set-password", component: SetPasswordComponent },
|
|
{ path: "sso", component: SsoComponent },
|
|
{
|
|
path: "send",
|
|
component: SendComponent,
|
|
canActivate: [authGuard],
|
|
},
|
|
{
|
|
path: "update-temp-password",
|
|
component: UpdateTempPasswordComponent,
|
|
canActivate: [authGuard],
|
|
},
|
|
{
|
|
path: "remove-password",
|
|
component: RemovePasswordComponent,
|
|
canActivate: [authGuard],
|
|
},
|
|
...unauthUiRefreshSwap(
|
|
HintComponent,
|
|
AnonLayoutWrapperComponent,
|
|
{
|
|
path: "hint",
|
|
canActivate: [unauthGuardFn()],
|
|
},
|
|
{
|
|
path: "",
|
|
children: [
|
|
{
|
|
path: "hint",
|
|
canActivate: [unauthGuardFn()],
|
|
data: {
|
|
pageTitle: "requestPasswordHint",
|
|
pageSubtitle: "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou",
|
|
pageIcon: UserLockIcon,
|
|
} satisfies AnonLayoutWrapperData,
|
|
children: [
|
|
{ path: "", component: PasswordHintComponent },
|
|
{
|
|
path: "",
|
|
component: EnvironmentSelectorComponent,
|
|
outlet: "environment-selector",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
),
|
|
{
|
|
path: "",
|
|
component: AnonLayoutWrapperComponent,
|
|
children: [
|
|
{
|
|
path: "signup",
|
|
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
|
data: { pageTitle: "createAccount" } satisfies AnonLayoutWrapperData,
|
|
children: [
|
|
{
|
|
path: "",
|
|
component: RegistrationStartComponent,
|
|
},
|
|
{
|
|
path: "",
|
|
component: RegistrationStartSecondaryComponent,
|
|
outlet: "secondary",
|
|
data: {
|
|
loginRoute: "/login",
|
|
} satisfies RegistrationStartSecondaryComponentData,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "finish-signup",
|
|
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
|
data: {
|
|
pageTitle: "setAStrongPassword",
|
|
pageSubtitle: "finishCreatingYourAccountBySettingAPassword",
|
|
} satisfies AnonLayoutWrapperData,
|
|
children: [
|
|
{
|
|
path: "",
|
|
component: RegistrationFinishComponent,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "lockV2",
|
|
canActivate: [canAccessFeature(FeatureFlag.ExtensionRefresh), lockGuard()],
|
|
data: {
|
|
pageIcon: LockIcon,
|
|
pageTitle: "yourVaultIsLockedV2",
|
|
showReadonlyHostname: true,
|
|
} satisfies AnonLayoutWrapperData,
|
|
children: [
|
|
{
|
|
path: "",
|
|
component: LockV2Component,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "set-password-jit",
|
|
canActivate: [canAccessFeature(FeatureFlag.EmailVerification)],
|
|
component: SetPasswordJitComponent,
|
|
data: {
|
|
pageTitle: "joinOrganization",
|
|
pageSubtitle: "finishJoiningThisOrganizationBySettingAMasterPassword",
|
|
} satisfies AnonLayoutWrapperData,
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [
|
|
RouterModule.forRoot(routes, {
|
|
useHash: true,
|
|
/*enableTracing: true,*/
|
|
}),
|
|
],
|
|
exports: [RouterModule],
|
|
})
|
|
export class AppRoutingModule {}
|