mirror of
https://github.com/bitwarden/browser
synced 2026-02-14 07:23:45 +00:00
Merge branch 'main' into ps/extension-refresh
This commit is contained in:
@@ -23,11 +23,10 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
||||
|
||||
import { BiometricErrors, BiometricErrorTypes } from "../../models/biometricErrors";
|
||||
import { BrowserRouterService } from "../../platform/popup/services/browser-router.service";
|
||||
|
||||
@@ -31,14 +31,13 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import {
|
||||
VaultTimeout,
|
||||
VaultTimeoutOption,
|
||||
VaultTimeoutStringType,
|
||||
} from "@bitwarden/common/types/vault-timeout.type";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
import { BiometricStateService, BiometricsService } from "@bitwarden/key-management";
|
||||
|
||||
import { BiometricErrors, BiometricErrorTypes } from "../../../models/biometricErrors";
|
||||
import { BrowserApi } from "../../../platform/browser/browser-api";
|
||||
|
||||
@@ -33,8 +33,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import {
|
||||
VaultTimeout,
|
||||
VaultTimeoutOption,
|
||||
@@ -54,6 +52,7 @@ import {
|
||||
TypographyModule,
|
||||
ToastService,
|
||||
} from "@bitwarden/components";
|
||||
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
||||
|
||||
import { BiometricErrors, BiometricErrorTypes } from "../../../models/biometricErrors";
|
||||
import { BrowserApi } from "../../../platform/browser/browser-api";
|
||||
|
||||
@@ -95,11 +95,6 @@ import {
|
||||
ObservableStorageService,
|
||||
} from "@bitwarden/common/platform/abstractions/storage.service";
|
||||
import { SystemService as SystemServiceAbstraction } from "@bitwarden/common/platform/abstractions/system.service";
|
||||
import {
|
||||
BiometricStateService,
|
||||
DefaultBiometricStateService,
|
||||
} from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import { StateFactory } from "@bitwarden/common/platform/factories/state-factory";
|
||||
import { Message, MessageListener, MessageSender } from "@bitwarden/common/platform/messaging";
|
||||
// eslint-disable-next-line no-restricted-imports -- Used for dependency creation
|
||||
@@ -197,6 +192,11 @@ import {
|
||||
ImportService,
|
||||
ImportServiceAbstraction,
|
||||
} from "@bitwarden/importer/core";
|
||||
import {
|
||||
BiometricStateService,
|
||||
DefaultBiometricStateService,
|
||||
BiometricsService,
|
||||
} from "@bitwarden/key-management";
|
||||
import {
|
||||
IndividualVaultExportService,
|
||||
IndividualVaultExportServiceAbstraction,
|
||||
@@ -225,6 +225,7 @@ import { BrowserFido2UserInterfaceService } from "../autofill/fido2/services/bro
|
||||
import { AutofillService as AutofillServiceAbstraction } from "../autofill/services/abstractions/autofill.service";
|
||||
import AutofillService from "../autofill/services/autofill.service";
|
||||
import { SafariApp } from "../browser/safariApp";
|
||||
import { BackgroundBrowserBiometricsService } from "../key-management/biometrics/background-browser-biometrics.service";
|
||||
import { BrowserApi } from "../platform/browser/browser-api";
|
||||
import { UpdateBadge } from "../platform/listeners/update-badge";
|
||||
/* eslint-disable no-restricted-imports */
|
||||
@@ -233,7 +234,6 @@ import { ChromeMessageSender } from "../platform/messaging/chrome-message.sender
|
||||
import { OffscreenDocumentService } from "../platform/offscreen-document/abstractions/offscreen-document";
|
||||
import { DefaultOffscreenDocumentService } from "../platform/offscreen-document/offscreen-document.service";
|
||||
import { BrowserTaskSchedulerService } from "../platform/services/abstractions/browser-task-scheduler.service";
|
||||
import { BackgroundBrowserBiometricsService } from "../platform/services/background-browser-biometrics.service";
|
||||
import { BrowserCryptoService } from "../platform/services/browser-crypto.service";
|
||||
import { BrowserEnvironmentService } from "../platform/services/browser-environment.service";
|
||||
import BrowserLocalStorageService from "../platform/services/browser-local-storage.service";
|
||||
|
||||
@@ -10,11 +10,11 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||
import { UserKey } from "@bitwarden/common/types/key";
|
||||
import { BiometricStateService } from "@bitwarden/key-management";
|
||||
|
||||
import { BrowserApi } from "../platform/browser/browser-api";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import { BiometricsService } from "@bitwarden/key-management";
|
||||
|
||||
import { BrowserApi } from "../browser/browser-api";
|
||||
import { BrowserApi } from "../../platform/browser/browser-api";
|
||||
|
||||
@Injectable()
|
||||
export abstract class BrowserBiometricsService extends BiometricsService {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BrowserApi } from "../browser/browser-api";
|
||||
import { BrowserApi } from "../../platform/browser/browser-api";
|
||||
|
||||
import { BrowserBiometricsService } from "./browser-biometrics.service";
|
||||
|
||||
@@ -10,14 +10,13 @@ import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/ke
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import { KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
||||
import { CryptoService } from "@bitwarden/common/platform/services/crypto.service";
|
||||
import { USER_KEY } from "@bitwarden/common/platform/services/key-state/user-key.state";
|
||||
import { StateProvider } from "@bitwarden/common/platform/state";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { UserKey } from "@bitwarden/common/types/key";
|
||||
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
||||
|
||||
export class BrowserCryptoService extends CryptoService {
|
||||
constructor(
|
||||
|
||||
@@ -31,7 +31,10 @@ import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-fa
|
||||
import { fido2AuthGuard } from "../auth/guards/fido2-auth.guard";
|
||||
import { AccountSwitcherComponent } from "../auth/popup/account-switching/account-switcher.component";
|
||||
import { EnvironmentComponent } from "../auth/popup/environment.component";
|
||||
import { ExtensionAnonLayoutWrapperComponent } from "../auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component";
|
||||
import {
|
||||
ExtensionAnonLayoutWrapperComponent,
|
||||
ExtensionAnonLayoutWrapperData,
|
||||
} from "../auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component";
|
||||
import { HintComponent } from "../auth/popup/hint.component";
|
||||
import { HomeComponent } from "../auth/popup/home.component";
|
||||
import { LockComponent } from "../auth/popup/lock.component";
|
||||
@@ -109,6 +112,21 @@ import { debounceNavigationGuard } from "./services/debounce-navigation.service"
|
||||
import { TabsV2Component } from "./tabs-v2.component";
|
||||
import { TabsComponent } from "./tabs.component";
|
||||
|
||||
/**
|
||||
* Data properties acceptable for use in extension route objects
|
||||
*/
|
||||
export interface RouteDataProperties {
|
||||
/**
|
||||
* A state string which identifies the current route for the sake of transition animation logic.
|
||||
* The state string is passed into [@routerTransition] in the app.component.
|
||||
*/
|
||||
state: string;
|
||||
/**
|
||||
* A boolean to indicate that the URL should not be saved in memory in the BrowserRouterSvc.
|
||||
*/
|
||||
doNotSaveUrl?: boolean;
|
||||
}
|
||||
|
||||
const unauthRouteOverrides = {
|
||||
homepage: () => {
|
||||
return BrowserPopupUtils.inPopout(window) ? "/tabs/vault" : "/tabs/current";
|
||||
@@ -134,36 +152,36 @@ const routes: Routes = [
|
||||
path: "home",
|
||||
component: HomeComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "home" },
|
||||
data: { state: "home" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(Fido2V1Component, Fido2Component, {
|
||||
path: "fido2",
|
||||
canActivate: [fido2AuthGuard],
|
||||
data: { state: "fido2" },
|
||||
data: { state: "fido2" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "login",
|
||||
component: LoginComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "login" },
|
||||
data: { state: "login" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "login-with-device",
|
||||
component: LoginViaAuthRequestComponent,
|
||||
canActivate: [],
|
||||
data: { state: "login-with-device" },
|
||||
data: { state: "login-with-device" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "admin-approval-requested",
|
||||
component: LoginViaAuthRequestComponent,
|
||||
canActivate: [],
|
||||
data: { state: "login-with-device" },
|
||||
data: { state: "login-with-device" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "lock",
|
||||
component: LockComponent,
|
||||
canActivate: [lockGuard()],
|
||||
data: { state: "lock", doNotSaveUrl: true },
|
||||
data: { state: "lock", doNotSaveUrl: true } satisfies RouteDataProperties,
|
||||
},
|
||||
...twofactorRefactorSwap(
|
||||
TwoFactorComponent,
|
||||
@@ -171,12 +189,12 @@ const routes: Routes = [
|
||||
{
|
||||
path: "2fa",
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "2fa" },
|
||||
data: { state: "2fa" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "2fa",
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "2fa" },
|
||||
data: { state: "2fa" } satisfies RouteDataProperties,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
@@ -189,200 +207,201 @@ const routes: Routes = [
|
||||
path: "2fa-options",
|
||||
component: TwoFactorOptionsComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "2fa-options" },
|
||||
data: { state: "2fa-options" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "login-initiated",
|
||||
component: LoginDecryptionOptionsComponent,
|
||||
canActivate: [tdeDecryptionRequiredGuard()],
|
||||
data: { state: "login-initiated" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "sso",
|
||||
component: SsoComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "sso" },
|
||||
data: { state: "sso" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "set-password",
|
||||
component: SetPasswordComponent,
|
||||
data: { state: "set-password" },
|
||||
data: { state: "set-password" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "remove-password",
|
||||
component: RemovePasswordComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "remove-password" },
|
||||
data: { state: "remove-password" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "register",
|
||||
component: RegisterComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "register" },
|
||||
data: { state: "register" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "environment",
|
||||
component: EnvironmentComponent,
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: { state: "environment" },
|
||||
data: { state: "environment" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "ciphers",
|
||||
component: VaultItemsComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "ciphers" },
|
||||
data: { state: "ciphers" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(ViewComponent, ViewV2Component, {
|
||||
path: "view-cipher",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "view-cipher" },
|
||||
data: { state: "view-cipher" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "cipher-password-history",
|
||||
component: PasswordHistoryComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "cipher-password-history" },
|
||||
data: { state: "cipher-password-history" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(AddEditComponent, AddEditV2Component, {
|
||||
path: "add-cipher",
|
||||
canActivate: [authGuard, debounceNavigationGuard()],
|
||||
data: { state: "add-cipher" },
|
||||
data: { state: "add-cipher" } satisfies RouteDataProperties,
|
||||
runGuardsAndResolvers: "always",
|
||||
}),
|
||||
...extensionRefreshSwap(AddEditComponent, AddEditV2Component, {
|
||||
path: "edit-cipher",
|
||||
canActivate: [authGuard, debounceNavigationGuard()],
|
||||
data: { state: "edit-cipher" },
|
||||
data: { state: "edit-cipher" } satisfies RouteDataProperties,
|
||||
runGuardsAndResolvers: "always",
|
||||
}),
|
||||
{
|
||||
path: "share-cipher",
|
||||
component: ShareComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "share-cipher" },
|
||||
data: { state: "share-cipher" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "collections",
|
||||
component: CollectionsComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "collections" },
|
||||
data: { state: "collections" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(AttachmentsComponent, AttachmentsV2Component, {
|
||||
path: "attachments",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "attachments" },
|
||||
data: { state: "attachments" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "generator",
|
||||
component: GeneratorComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "generator" },
|
||||
data: { state: "generator" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(PasswordGeneratorHistoryComponent, CredentialGeneratorHistoryComponent, {
|
||||
path: "generator-history",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "generator-history" },
|
||||
data: { state: "generator-history" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(ImportBrowserComponent, ImportBrowserV2Component, {
|
||||
path: "import",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "import" },
|
||||
data: { state: "import" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(ExportBrowserComponent, ExportBrowserV2Component, {
|
||||
path: "export",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "export" },
|
||||
data: { state: "export" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(AutofillV1Component, AutofillComponent, {
|
||||
path: "autofill",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "autofill" },
|
||||
data: { state: "autofill" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(AccountSecurityV1Component, AccountSecurityComponent, {
|
||||
path: "account-security",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "account-security" },
|
||||
data: { state: "account-security" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(NotificationsSettingsV1Component, NotificationsSettingsComponent, {
|
||||
path: "notifications",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "notifications" },
|
||||
data: { state: "notifications" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(VaultSettingsComponent, VaultSettingsV2Component, {
|
||||
path: "vault-settings",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "vault-settings" },
|
||||
data: { state: "vault-settings" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(FoldersComponent, FoldersV2Component, {
|
||||
path: "folders",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "folders" },
|
||||
data: { state: "folders" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "add-folder",
|
||||
component: FolderAddEditComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "add-folder" },
|
||||
data: { state: "add-folder" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "edit-folder",
|
||||
component: FolderAddEditComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "edit-folder" },
|
||||
data: { state: "edit-folder" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "sync",
|
||||
component: SyncComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "sync" },
|
||||
data: { state: "sync" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(ExcludedDomainsV1Component, ExcludedDomainsComponent, {
|
||||
path: "excluded-domains",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "excluded-domains" },
|
||||
data: { state: "excluded-domains" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(PremiumComponent, PremiumV2Component, {
|
||||
path: "premium",
|
||||
component: PremiumComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "premium" },
|
||||
data: { state: "premium" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(AppearanceComponent, AppearanceV2Component, {
|
||||
path: "appearance",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "appearance" },
|
||||
data: { state: "appearance" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(AddEditComponent, AddEditV2Component, {
|
||||
path: "clone-cipher",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "clone-cipher" },
|
||||
data: { state: "clone-cipher" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "send-type",
|
||||
component: SendTypeComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "send-type" },
|
||||
data: { state: "send-type" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(SendAddEditComponent, SendAddEditV2Component, {
|
||||
path: "add-send",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "add-send" },
|
||||
data: { state: "add-send" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(SendAddEditComponent, SendAddEditV2Component, {
|
||||
path: "edit-send",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "edit-send" },
|
||||
data: { state: "edit-send" } satisfies RouteDataProperties,
|
||||
}),
|
||||
{
|
||||
path: "send-created",
|
||||
component: SendCreatedComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "send" },
|
||||
data: { state: "send" } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "update-temp-password",
|
||||
component: UpdateTempPasswordComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "update-temp-password" },
|
||||
data: { state: "update-temp-password" } satisfies RouteDataProperties,
|
||||
},
|
||||
...unauthUiRefreshSwap(
|
||||
HintComponent,
|
||||
@@ -392,7 +411,7 @@ const routes: Routes = [
|
||||
canActivate: [unauthGuardFn(unauthRouteOverrides)],
|
||||
data: {
|
||||
state: "hint",
|
||||
},
|
||||
} satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
@@ -406,7 +425,7 @@ const routes: Routes = [
|
||||
pageIcon: UserLockIcon,
|
||||
showBackButton: true,
|
||||
state: "hint",
|
||||
},
|
||||
} satisfies RouteDataProperties & ExtensionAnonLayoutWrapperData,
|
||||
children: [
|
||||
{ path: "", component: PasswordHintComponent },
|
||||
{
|
||||
@@ -426,7 +445,10 @@ const routes: Routes = [
|
||||
{
|
||||
path: "signup",
|
||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
||||
data: { pageTitle: "createAccount" } satisfies AnonLayoutWrapperData,
|
||||
data: {
|
||||
state: "signup",
|
||||
pageTitle: "createAccount",
|
||||
} satisfies RouteDataProperties & AnonLayoutWrapperData,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
@@ -448,7 +470,8 @@ const routes: Routes = [
|
||||
data: {
|
||||
pageTitle: "setAStrongPassword",
|
||||
pageSubtitle: "finishCreatingYourAccountBySettingAPassword",
|
||||
} satisfies AnonLayoutWrapperData,
|
||||
state: "finish-signup",
|
||||
} satisfies RouteDataProperties & AnonLayoutWrapperData,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
@@ -463,7 +486,8 @@ const routes: Routes = [
|
||||
data: {
|
||||
pageTitle: "joinOrganization",
|
||||
pageSubtitle: "finishJoiningThisOrganizationBySettingAMasterPassword",
|
||||
} satisfies AnonLayoutWrapperData,
|
||||
state: "set-password-jit",
|
||||
} satisfies RouteDataProperties & AnonLayoutWrapperData,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -471,21 +495,21 @@ const routes: Routes = [
|
||||
path: "assign-collections",
|
||||
component: AssignCollections,
|
||||
canActivate: [canAccessFeature(FeatureFlag.ExtensionRefresh, true, "/")],
|
||||
data: { state: "assign-collections" },
|
||||
data: { state: "assign-collections" } satisfies RouteDataProperties,
|
||||
},
|
||||
...extensionRefreshSwap(AboutPageComponent, AboutPageV2Component, {
|
||||
path: "about",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "about" },
|
||||
data: { state: "about" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(MoreFromBitwardenPageComponent, MoreFromBitwardenPageV2Component, {
|
||||
path: "more-from-bitwarden",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "moreFromBitwarden" },
|
||||
data: { state: "moreFromBitwarden" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(TabsComponent, TabsV2Component, {
|
||||
path: "tabs",
|
||||
data: { state: "tabs" },
|
||||
data: { state: "tabs" } satisfies RouteDataProperties,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
@@ -497,42 +521,42 @@ const routes: Routes = [
|
||||
component: CurrentTabComponent,
|
||||
canActivate: [authGuard],
|
||||
canMatch: [extensionRefreshRedirect("/tabs/vault")],
|
||||
data: { state: "tabs_current" },
|
||||
data: { state: "tabs_current" } satisfies RouteDataProperties,
|
||||
runGuardsAndResolvers: "always",
|
||||
},
|
||||
...extensionRefreshSwap(VaultFilterComponent, VaultV2Component, {
|
||||
path: "vault",
|
||||
canActivate: [authGuard],
|
||||
canDeactivate: [clearVaultStateGuard],
|
||||
data: { state: "tabs_vault" },
|
||||
data: { state: "tabs_vault" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...generatorSwap(GeneratorComponent, CredentialGeneratorComponent, {
|
||||
path: "generator",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "tabs_generator" },
|
||||
data: { state: "tabs_generator" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(SettingsComponent, SettingsV2Component, {
|
||||
path: "settings",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "tabs_settings" },
|
||||
data: { state: "tabs_settings" } satisfies RouteDataProperties,
|
||||
}),
|
||||
...extensionRefreshSwap(SendGroupingsComponent, SendV2Component, {
|
||||
path: "send",
|
||||
canActivate: [authGuard],
|
||||
data: { state: "tabs_send" },
|
||||
data: { state: "tabs_send" } satisfies RouteDataProperties,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
{
|
||||
path: "account-switcher",
|
||||
component: AccountSwitcherComponent,
|
||||
data: { state: "account-switcher", doNotSaveUrl: true },
|
||||
data: { state: "account-switcher", doNotSaveUrl: true } satisfies RouteDataProperties,
|
||||
},
|
||||
{
|
||||
path: "trash",
|
||||
component: TrashComponent,
|
||||
canActivate: [authGuard],
|
||||
data: { state: "trash" },
|
||||
data: { state: "trash" } satisfies RouteDataProperties,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -62,8 +62,6 @@ import {
|
||||
AbstractStorageService,
|
||||
ObservableStorageService,
|
||||
} from "@bitwarden/common/platform/abstractions/storage.service";
|
||||
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
||||
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
|
||||
import { Message, MessageListener, MessageSender } from "@bitwarden/common/platform/messaging";
|
||||
// eslint-disable-next-line no-restricted-imports -- Used for dependency injection
|
||||
import { SubjectMessageSender } from "@bitwarden/common/platform/messaging/internal";
|
||||
@@ -89,6 +87,7 @@ import { FolderService as FolderServiceAbstraction } from "@bitwarden/common/vau
|
||||
import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/vault/abstractions/totp.service";
|
||||
import { TotpService } from "@bitwarden/common/vault/services/totp.service";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
||||
import { PasswordRepromptService } from "@bitwarden/vault";
|
||||
|
||||
import { ForegroundLockService } from "../../auth/popup/accounts/foreground-lock.service";
|
||||
@@ -96,6 +95,7 @@ import { ExtensionAnonLayoutWrapperDataService } from "../../auth/popup/extensio
|
||||
import { AutofillService as AutofillServiceAbstraction } from "../../autofill/services/abstractions/autofill.service";
|
||||
import AutofillService from "../../autofill/services/autofill.service";
|
||||
import MainBackground from "../../background/main.background";
|
||||
import { ForegroundBrowserBiometricsService } from "../../key-management/biometrics/foreground-browser-biometrics";
|
||||
import { BrowserApi } from "../../platform/browser/browser-api";
|
||||
import { runInsideAngular } from "../../platform/browser/run-inside-angular.operator";
|
||||
/* eslint-disable no-restricted-imports */
|
||||
@@ -111,7 +111,6 @@ import { BrowserCryptoService } from "../../platform/services/browser-crypto.ser
|
||||
import { BrowserEnvironmentService } from "../../platform/services/browser-environment.service";
|
||||
import BrowserLocalStorageService from "../../platform/services/browser-local-storage.service";
|
||||
import { BrowserScriptInjectorService } from "../../platform/services/browser-script-injector.service";
|
||||
import { ForegroundBrowserBiometricsService } from "../../platform/services/foreground-browser-biometrics";
|
||||
import I18nService from "../../platform/services/i18n.service";
|
||||
import { ForegroundPlatformUtilsService } from "../../platform/services/platform-utils/foreground-platform-utils.service";
|
||||
import { ForegroundTaskSchedulerService } from "../../platform/services/task-scheduler/foreground-task-scheduler.service";
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
"@bitwarden/importer/ui": ["../../libs/importer/src/components"],
|
||||
"@bitwarden/platform": ["../../libs/platform/src"],
|
||||
"@bitwarden/send-ui": ["../../libs/tools/send/send-ui/src"],
|
||||
"@bitwarden/key-management": ["../../libs/key-management/src"],
|
||||
"@bitwarden/vault": ["../../libs/vault/src"]
|
||||
},
|
||||
"useDefineForClassFields": false
|
||||
|
||||
Reference in New Issue
Block a user