Skip to content

Commit

Permalink
fix(email-verification-feature-flag): [PM-7882] Email Verification - …
Browse files Browse the repository at this point in the history
…Update routing to restore functionality and added back in comment.
  • Loading branch information
Patrick-Pimentel-Bitwarden committed Jan 17, 2025
1 parent e8da9fa commit f7672e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
return;
}

// if SSO is disabled OR if sso is enabled but the SSO login required policy is not enabled
// then send user to create account

// We don't need users to complete email verification if they are coming directly from an emailed invite.
// Therefore, we skip /signup and navigate directly to /finish-signup.
await this.router.navigate(["/finish-signup"], {

Check warning on line 89 in apps/web/src/app/auth/organization-invite/accept-organization.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/auth/organization-invite/accept-organization.component.ts#L89

Added line #L89 was not covered by tests
Expand Down
26 changes: 13 additions & 13 deletions apps/web/src/app/oss-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
unauthGuardFn,
} from "@bitwarden/angular/auth/guards";
import { generatorSwap } from "@bitwarden/angular/tools/generator/generator-swap";
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";

Check warning on line 14 in apps/web/src/app/oss-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/oss-routing.module.ts#L14

Added line #L14 was not covered by tests
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
import {
AnonLayoutWrapperComponent,
Expand Down Expand Up @@ -44,7 +45,6 @@ import {
VaultIcons,
} from "@bitwarden/vault";

import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
import { flagEnabled, Flags } from "../utils/flags";

import { VerifyRecoverDeleteOrgComponent } from "./admin-console/organizations/manage/verify-recover-delete-org.component";
Expand All @@ -69,7 +69,6 @@ import { SecurityRoutingModule } from "./auth/settings/security/security-routing
import { SsoComponentV1 } from "./auth/sso-v1.component";
import { CompleteTrialInitiationComponent } from "./auth/trial-initiation/complete-trial-initiation/complete-trial-initiation.component";
import { freeTrialTextResolver } from "./auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver";
import { TrialInitiationComponent } from "./auth/trial-initiation/trial-initiation.component";
import { TwoFactorAuthComponent } from "./auth/two-factor-auth.component";
import { TwoFactorComponent } from "./auth/two-factor.component";
import { UpdatePasswordComponent } from "./auth/update-password.component";
Expand All @@ -94,6 +93,18 @@ import { SendComponent } from "./tools/send/send.component";
import { VaultModule } from "./vault/individual-vault/vault.module";

const routes: Routes = [
// These need to be placed at the top of the list prior to the root
// so that the redirectGuard does not interrupt the navigation.
{
path: "register",
redirectTo: "signup",
pathMatch: "full",
},
{
path: "trial",
redirectTo: "signup",
pathMatch: "full",
},
{
path: "",
component: FrontendLayoutComponent,
Expand All @@ -110,17 +121,6 @@ const routes: Routes = [
component: LoginViaWebAuthnComponent,
data: { titleId: "logInWithPasskey" } satisfies RouteDataProperties,
},
{
path: "register",
component: TrialInitiationComponent,
canActivate: [unauthGuardFn()],
data: { titleId: "createAccount" } satisfies RouteDataProperties,
},
{
path: "trial",
redirectTo: "register",
pathMatch: "full",
},
{
path: "set-password",
component: SetPasswordComponent,
Expand Down

0 comments on commit f7672e4

Please sign in to comment.