mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-25 12:15:18 +01:00
Manually route to signup page when the email verification feature flag is enabled
This commit is contained in:
parent
a4156799e9
commit
f3a2b412b9
@ -1,5 +1,5 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { Route, RouterModule, Routes } from "@angular/router";
|
||||
import { inject, NgModule } from "@angular/core";
|
||||
import { Route, Router, RouterModule, Routes } from "@angular/router";
|
||||
|
||||
import { unauthUiRefreshSwap } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-route-swap";
|
||||
import {
|
||||
@ -33,6 +33,7 @@ import {
|
||||
VaultIcon,
|
||||
} from "@bitwarden/auth/angular";
|
||||
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 { flagEnabled, Flags } from "../utils/flags";
|
||||
@ -120,7 +121,17 @@ const routes: Routes = [
|
||||
path: "register",
|
||||
component: TrialInitiationComponent,
|
||||
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(),
|
||||
],
|
||||
data: { titleId: "createAccount" } satisfies RouteDataProperties,
|
||||
|
Loading…
Reference in New Issue
Block a user