mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
Manually route to signup page when the email verification feature flag is enabled
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { NgModule } from "@angular/core";
|
import { inject, NgModule } from "@angular/core";
|
||||||
import { Route, RouterModule, Routes } from "@angular/router";
|
import { Route, Router, RouterModule, Routes } from "@angular/router";
|
||||||
|
|
||||||
import { unauthUiRefreshSwap } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-route-swap";
|
import { unauthUiRefreshSwap } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-route-swap";
|
||||||
import {
|
import {
|
||||||
@@ -33,6 +33,7 @@ import {
|
|||||||
VaultIcon,
|
VaultIcon,
|
||||||
} from "@bitwarden/auth/angular";
|
} from "@bitwarden/auth/angular";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||||
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
|
|
||||||
import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
|
import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
|
||||||
import { flagEnabled, Flags } from "../utils/flags";
|
import { flagEnabled, Flags } from "../utils/flags";
|
||||||
@@ -120,7 +121,17 @@ const routes: Routes = [
|
|||||||
path: "register",
|
path: "register",
|
||||||
component: TrialInitiationComponent,
|
component: TrialInitiationComponent,
|
||||||
canActivate: [
|
canActivate: [
|
||||||
canAccessFeature(FeatureFlag.EmailVerification, false, "/signup"),
|
async () => {
|
||||||
|
const configService = inject(ConfigService);
|
||||||
|
const router = inject(Router);
|
||||||
|
|
||||||
|
return configService.getFeatureFlag(FeatureFlag.EmailVerification).then((flagValue) => {
|
||||||
|
if (flagValue === true) {
|
||||||
|
return router.createUrlTree(["/signup"]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
},
|
||||||
unauthGuardFn(),
|
unauthGuardFn(),
|
||||||
],
|
],
|
||||||
data: { titleId: "createAccount" } satisfies RouteDataProperties,
|
data: { titleId: "createAccount" } satisfies RouteDataProperties,
|
||||||
|
|||||||
Reference in New Issue
Block a user