mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
refactor(email-verification-feature-flag): [PM-7882] Email Verificati… (#12718)
* refactor(email-verification-feature-flag): [PM-7882] Email Verification - Removed email feature flag.
This commit is contained in:
committed by
GitHub
parent
ecb0d1e2f3
commit
eb99eba284
@@ -1,4 +1,4 @@
|
|||||||
<app-header [noTheme]="true"> </app-header>
|
<app-header [noTheme]="true"></app-header>
|
||||||
<div class="center-content">
|
<div class="center-content">
|
||||||
<div class="content login-page">
|
<div class="content login-page">
|
||||||
<div class="logo-image"></div>
|
<div class="logo-image"></div>
|
||||||
@@ -30,9 +30,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<p class="createAccountLink">
|
<p class="createAccountLink">
|
||||||
{{ "newAroundHere" | i18n }}
|
{{ "newAroundHere" | i18n }}
|
||||||
<a [routerLink]="registerRoute$ | async" (click)="setLoginEmailValues()">{{
|
<a routerLink="/signup" (click)="setLoginEmailValues()">{{ "createAccount" | i18n }}</a>
|
||||||
"createAccount" | i18n
|
|
||||||
}}</a>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from "@angular/router";
|
|||||||
import { Subject, firstValueFrom, switchMap, takeUntil, tap } from "rxjs";
|
import { Subject, firstValueFrom, switchMap, takeUntil, tap } from "rxjs";
|
||||||
|
|
||||||
import { EnvironmentSelectorComponent } from "@bitwarden/angular/auth/components/environment-selector.component";
|
import { EnvironmentSelectorComponent } from "@bitwarden/angular/auth/components/environment-selector.component";
|
||||||
import { LoginEmailServiceAbstraction, RegisterRouteService } from "@bitwarden/auth/common";
|
import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common";
|
||||||
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 { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
@@ -30,9 +30,6 @@ export class HomeComponent implements OnInit, OnDestroy {
|
|||||||
rememberEmail: [false],
|
rememberEmail: [false],
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected platformUtilsService: PlatformUtilsService,
|
protected platformUtilsService: PlatformUtilsService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
@@ -40,7 +37,6 @@ export class HomeComponent implements OnInit, OnDestroy {
|
|||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private loginEmailService: LoginEmailServiceAbstraction,
|
private loginEmailService: LoginEmailServiceAbstraction,
|
||||||
private accountSwitcherService: AccountSwitcherService,
|
private accountSwitcherService: AccountSwitcherService,
|
||||||
private registerRouteService: RegisterRouteService,
|
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private configService: ConfigService,
|
private configService: ConfigService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@@ -118,13 +114,15 @@ export class HomeComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.setLoginEmailValues();
|
await this.setLoginEmailValues();
|
||||||
await this.router.navigate(["login"], { queryParams: { email: this.formGroup.value.email } });
|
await this.router.navigate(["login"], {
|
||||||
|
queryParams: { email: this.formGroup.controls.email.value },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async setLoginEmailValues() {
|
async setLoginEmailValues() {
|
||||||
// Note: Browser saves email settings here instead of the login component
|
// Note: Browser saves email settings here instead of the login component
|
||||||
this.loginEmailService.setRememberEmail(this.formGroup.value.rememberEmail);
|
this.loginEmailService.setRememberEmail(this.formGroup.controls.rememberEmail.value);
|
||||||
await this.loginEmailService.setLoginEmail(this.formGroup.value.email);
|
await this.loginEmailService.setLoginEmail(this.formGroup.controls.email.value);
|
||||||
await this.loginEmailService.saveEmailSettings();
|
await this.loginEmailService.saveEmailSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,9 @@ import { FormValidationErrorsService } from "@bitwarden/angular/platform/abstrac
|
|||||||
import {
|
import {
|
||||||
LoginStrategyServiceAbstraction,
|
LoginStrategyServiceAbstraction,
|
||||||
LoginEmailServiceAbstraction,
|
LoginEmailServiceAbstraction,
|
||||||
RegisterRouteService,
|
|
||||||
} from "@bitwarden/auth/common";
|
} from "@bitwarden/auth/common";
|
||||||
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
||||||
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
||||||
import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login.service.abstraction";
|
|
||||||
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
||||||
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
||||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
@@ -51,8 +49,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
loginEmailService: LoginEmailServiceAbstraction,
|
loginEmailService: LoginEmailServiceAbstraction,
|
||||||
ssoLoginService: SsoLoginServiceAbstraction,
|
ssoLoginService: SsoLoginServiceAbstraction,
|
||||||
webAuthnLoginService: WebAuthnLoginServiceAbstraction,
|
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
toastService: ToastService,
|
toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
@@ -73,8 +69,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
route,
|
route,
|
||||||
loginEmailService,
|
loginEmailService,
|
||||||
ssoLoginService,
|
ssoLoginService,
|
||||||
webAuthnLoginService,
|
|
||||||
registerRouteService,
|
|
||||||
toastService,
|
toastService,
|
||||||
);
|
);
|
||||||
this.onSuccessfulLogin = async () => {
|
this.onSuccessfulLogin = async () => {
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
tdeDecryptionRequiredGuard,
|
tdeDecryptionRequiredGuard,
|
||||||
unauthGuardFn,
|
unauthGuardFn,
|
||||||
} from "@bitwarden/angular/auth/guards";
|
} from "@bitwarden/angular/auth/guards";
|
||||||
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
|
|
||||||
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
|
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
|
||||||
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
||||||
import {
|
import {
|
||||||
@@ -41,7 +40,6 @@ import {
|
|||||||
SsoComponent,
|
SsoComponent,
|
||||||
TwoFactorTimeoutIcon,
|
TwoFactorTimeoutIcon,
|
||||||
} from "@bitwarden/auth/angular";
|
} from "@bitwarden/auth/angular";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { LockComponent } from "@bitwarden/key-management/angular";
|
import { LockComponent } from "@bitwarden/key-management/angular";
|
||||||
import {
|
import {
|
||||||
NewDeviceVerificationNoticePageOneComponent,
|
NewDeviceVerificationNoticePageOneComponent,
|
||||||
@@ -559,7 +557,7 @@ const routes: Routes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "signup",
|
path: "signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
pageIcon: RegistrationUserAddIcon,
|
pageIcon: RegistrationUserAddIcon,
|
||||||
@@ -585,7 +583,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "finish-signup",
|
path: "finish-signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationLockAltIcon,
|
pageIcon: RegistrationLockAltIcon,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
@@ -635,7 +633,6 @@ const routes: Routes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "set-password-jit",
|
path: "set-password-jit",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification)],
|
|
||||||
component: SetPasswordJitComponent,
|
component: SetPasswordJitComponent,
|
||||||
data: {
|
data: {
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import {
|
|||||||
tdeDecryptionRequiredGuard,
|
tdeDecryptionRequiredGuard,
|
||||||
unauthGuardFn,
|
unauthGuardFn,
|
||||||
} from "@bitwarden/angular/auth/guards";
|
} from "@bitwarden/angular/auth/guards";
|
||||||
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
|
|
||||||
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
|
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
|
||||||
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
||||||
import {
|
import {
|
||||||
@@ -39,7 +38,6 @@ import {
|
|||||||
SsoComponent,
|
SsoComponent,
|
||||||
TwoFactorTimeoutIcon,
|
TwoFactorTimeoutIcon,
|
||||||
} from "@bitwarden/auth/angular";
|
} from "@bitwarden/auth/angular";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { LockComponent } from "@bitwarden/key-management/angular";
|
import { LockComponent } from "@bitwarden/key-management/angular";
|
||||||
import {
|
import {
|
||||||
NewDeviceVerificationNoticePageOneComponent,
|
NewDeviceVerificationNoticePageOneComponent,
|
||||||
@@ -330,7 +328,7 @@ const routes: Routes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "signup",
|
path: "signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationUserAddIcon,
|
pageIcon: RegistrationUserAddIcon,
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
@@ -354,7 +352,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "finish-signup",
|
path: "finish-signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationLockAltIcon,
|
pageIcon: RegistrationLockAltIcon,
|
||||||
} satisfies AnonLayoutWrapperData,
|
} satisfies AnonLayoutWrapperData,
|
||||||
@@ -384,7 +382,6 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "set-password-jit",
|
path: "set-password-jit",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification)],
|
|
||||||
component: SetPasswordJitComponent,
|
component: SetPasswordJitComponent,
|
||||||
data: {
|
data: {
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="sub-options">
|
<div class="sub-options">
|
||||||
<p class="no-margin">{{ "newAroundHere" | i18n }}</p>
|
<p class="no-margin">{{ "newAroundHere" | i18n }}</p>
|
||||||
<button type="button" class="text text-primary" [routerLink]="registerRoute$ | async">
|
<button type="button" class="text text-primary" routerLink="/signup">
|
||||||
{{ "createAccount" | i18n }}
|
{{ "createAccount" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,11 +11,9 @@ import { ModalService } from "@bitwarden/angular/services/modal.service";
|
|||||||
import {
|
import {
|
||||||
LoginStrategyServiceAbstraction,
|
LoginStrategyServiceAbstraction,
|
||||||
LoginEmailServiceAbstraction,
|
LoginEmailServiceAbstraction,
|
||||||
RegisterRouteService,
|
|
||||||
} from "@bitwarden/auth/common";
|
} from "@bitwarden/auth/common";
|
||||||
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
||||||
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
||||||
import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login.service.abstraction";
|
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||||
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
||||||
import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service";
|
import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service";
|
||||||
@@ -77,8 +75,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit, OnDe
|
|||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
loginEmailService: LoginEmailServiceAbstraction,
|
loginEmailService: LoginEmailServiceAbstraction,
|
||||||
ssoLoginService: SsoLoginServiceAbstraction,
|
ssoLoginService: SsoLoginServiceAbstraction,
|
||||||
webAuthnLoginService: WebAuthnLoginServiceAbstraction,
|
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
toastService: ToastService,
|
toastService: ToastService,
|
||||||
private configService: ConfigService,
|
private configService: ConfigService,
|
||||||
) {
|
) {
|
||||||
@@ -100,8 +96,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit, OnDe
|
|||||||
route,
|
route,
|
||||||
loginEmailService,
|
loginEmailService,
|
||||||
ssoLoginService,
|
ssoLoginService,
|
||||||
webAuthnLoginService,
|
|
||||||
registerRouteService,
|
|
||||||
toastService,
|
toastService,
|
||||||
);
|
);
|
||||||
this.onSuccessfulLogin = () => {
|
this.onSuccessfulLogin = () => {
|
||||||
@@ -228,7 +222,7 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save off email for SSO
|
// Save off email for SSO
|
||||||
await this.ssoLoginService.setSsoEmail(this.formGroup.value.email);
|
await this.ssoLoginService.setSsoEmail(this.formGroup.controls.email.value);
|
||||||
|
|
||||||
// Generate necessary sso params
|
// Generate necessary sso params
|
||||||
const passwordOptions: any = {
|
const passwordOptions: any = {
|
||||||
@@ -247,6 +241,7 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit, OnDe
|
|||||||
// Save sso params
|
// Save sso params
|
||||||
await this.ssoLoginService.setSsoState(state);
|
await this.ssoLoginService.setSsoState(state);
|
||||||
await this.ssoLoginService.setCodeVerifier(ssoCodeVerifier);
|
await this.ssoLoginService.setCodeVerifier(ssoCodeVerifier);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await ipc.platform.localhostCallbackService.openSsoPrompt(codeChallenge, state);
|
await ipc.platform.localhostCallbackService.openSsoPrompt(codeChallenge, state);
|
||||||
// FIXME: Remove when updating file. Eslint update
|
// FIXME: Remove when updating file. Eslint update
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, inject } from "@angular/core";
|
import { Component, inject } from "@angular/core";
|
||||||
import { Params } from "@angular/router";
|
import { Params } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
|
||||||
|
|
||||||
import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction";
|
import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction";
|
||||||
import { OrganizationSponsorshipResponse } from "@bitwarden/common/admin-console/models/response/organization-sponsorship.response";
|
import { OrganizationSponsorshipResponse } from "@bitwarden/common/admin-console/models/response/organization-sponsorship.response";
|
||||||
@@ -39,31 +38,18 @@ export class AcceptFamilySponsorshipComponent extends BaseAcceptComponent {
|
|||||||
if (!qParams.register) {
|
if (!qParams.register) {
|
||||||
await this.router.navigate(["/login"], { queryParams: { email: qParams.email } });
|
await this.router.navigate(["/login"], { queryParams: { email: qParams.email } });
|
||||||
} else {
|
} else {
|
||||||
// TODO: update logic when email verification flag is removed
|
// We don't need users to complete email verification if they are coming directly from an emailed invite.
|
||||||
let queryParams: Params;
|
// Therefore, we skip /signup and navigate directly to /finish-signup.
|
||||||
let registerRoute = await firstValueFrom(this.registerRoute$);
|
|
||||||
if (registerRoute === "/register") {
|
|
||||||
queryParams = {
|
|
||||||
email: qParams.email,
|
|
||||||
};
|
|
||||||
} else if (registerRoute === "/signup") {
|
|
||||||
// We have to override the base component route as we don't need users to
|
|
||||||
// complete email verification if they are coming directly an emailed invite.
|
|
||||||
|
|
||||||
// TODO: in the future, to allow users to enter a name, consider sending all invite users to
|
// TODO: in the future, to allow users to enter a name, consider sending all invite users to
|
||||||
// start registration page with prefilled email and a named token to be passed directly
|
// start registration page with prefilled email and a named token to be passed directly
|
||||||
// along to the finish-signup page without requiring email verification as
|
// along to the finish-signup page without requiring email verification as
|
||||||
// we can treat the existence of the token as a form of email verification.
|
// we can treat the existence of the token as a form of email verification.
|
||||||
|
await this.router.navigate(["/finish-signup"], {
|
||||||
registerRoute = "/finish-signup";
|
queryParams: {
|
||||||
queryParams = {
|
|
||||||
email: qParams.email,
|
email: qParams.email,
|
||||||
orgSponsoredFreeFamilyPlanToken: qParams.token,
|
orgSponsoredFreeFamilyPlanToken: qParams.token,
|
||||||
};
|
},
|
||||||
}
|
|
||||||
|
|
||||||
await this.router.navigate([registerRoute], {
|
|
||||||
queryParams: queryParams,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,19 +48,18 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
|||||||
loading = true;
|
loading = true;
|
||||||
badToken = false;
|
badToken = false;
|
||||||
|
|
||||||
token: string;
|
token!: string;
|
||||||
existingFamilyOrganizations: Organization[];
|
existingFamilyOrganizations$!: Observable<Organization[]>;
|
||||||
existingFamilyOrganizations$: Observable<Organization[]>;
|
|
||||||
|
|
||||||
showNewOrganization = false;
|
showNewOrganization = false;
|
||||||
_organizationPlansComponent: OrganizationPlansComponent;
|
preValidateSponsorshipResponse!: PreValidateSponsorshipResponse;
|
||||||
preValidateSponsorshipResponse: PreValidateSponsorshipResponse;
|
|
||||||
_selectedFamilyOrganizationId = "";
|
_selectedFamilyOrganizationId = "";
|
||||||
|
|
||||||
private _destroy = new Subject<void>();
|
private _destroy = new Subject<void>();
|
||||||
formGroup = this.formBuilder.group({
|
formGroup = this.formBuilder.group({
|
||||||
selectedFamilyOrganizationId: ["", Validators.required],
|
selectedFamilyOrganizationId: ["", Validators.required],
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ActivatedRoute, Params, Router } from "@angular/router";
|
import { ActivatedRoute, Params, Router } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
|
||||||
|
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
@@ -34,10 +32,9 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
|
|||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
private emergencyAccessService: EmergencyAccessService,
|
private emergencyAccessService: EmergencyAccessService,
|
||||||
) {
|
) {
|
||||||
super(router, platformUtilsService, i18nService, route, authService, registerRouteService);
|
super(router, platformUtilsService, i18nService, route, authService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async authedHandler(qParams: Params): Promise<void> {
|
async authedHandler(qParams: Params): Promise<void> {
|
||||||
@@ -71,25 +68,14 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async register() {
|
async register() {
|
||||||
let queryParams: Params;
|
// We don't need users to complete email verification if they are coming directly from an emailed invite.
|
||||||
let registerRoute = await firstValueFrom(this.registerRoute$);
|
// Therefore, we skip /signup and navigate directly to /finish-signup.
|
||||||
if (registerRoute === "/register") {
|
await this.router.navigate(["/finish-signup"], {
|
||||||
queryParams = {
|
queryParams: {
|
||||||
email: this.email,
|
|
||||||
};
|
|
||||||
} else if (registerRoute === "/signup") {
|
|
||||||
// We have to override the base component route as we don't need users to
|
|
||||||
// complete email verification if they are coming directly an emailed invite.
|
|
||||||
registerRoute = "/finish-signup";
|
|
||||||
queryParams = {
|
|
||||||
email: this.email,
|
email: this.email,
|
||||||
acceptEmergencyAccessInviteToken: this.acceptEmergencyAccessInviteToken,
|
acceptEmergencyAccessInviteToken: this.acceptEmergencyAccessInviteToken,
|
||||||
emergencyAccessId: this.emergencyAccessId,
|
emergencyAccessId: this.emergencyAccessId,
|
||||||
};
|
},
|
||||||
}
|
|
||||||
|
|
||||||
await this.router.navigate([registerRoute], {
|
|
||||||
queryParams: queryParams,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,12 @@
|
|||||||
-->
|
-->
|
||||||
<a
|
<a
|
||||||
bitLink
|
bitLink
|
||||||
[routerLink]="registerRoute$ | async"
|
routerLink="/signup"
|
||||||
[queryParams]="emailFormControl.valid ? { email: emailFormControl.value } : {}"
|
[queryParams]="emailFormControl.valid ? { email: emailFormControl.value } : {}"
|
||||||
(mousedown)="goToRegister()"
|
(mousedown)="goToRegister()"
|
||||||
>{{ "createAccount" | i18n }}</a
|
|
||||||
>
|
>
|
||||||
|
{{ "createAccount" | i18n }}
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { Component, NgZone, OnInit } from "@angular/core";
|
import { Component, NgZone, OnInit } from "@angular/core";
|
||||||
import { FormBuilder } from "@angular/forms";
|
import { FormBuilder } from "@angular/forms";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import { firstValueFrom, takeUntil } from "rxjs";
|
import { takeUntil } from "rxjs";
|
||||||
import { first } from "rxjs/operators";
|
import { first } from "rxjs/operators";
|
||||||
|
|
||||||
import { LoginComponentV1 as BaseLoginComponent } from "@bitwarden/angular/auth/components/login-v1.component";
|
import { LoginComponentV1 as BaseLoginComponent } from "@bitwarden/angular/auth/components/login-v1.component";
|
||||||
@@ -11,7 +11,6 @@ import { FormValidationErrorsService } from "@bitwarden/angular/platform/abstrac
|
|||||||
import {
|
import {
|
||||||
LoginStrategyServiceAbstraction,
|
LoginStrategyServiceAbstraction,
|
||||||
LoginEmailServiceAbstraction,
|
LoginEmailServiceAbstraction,
|
||||||
RegisterRouteService,
|
|
||||||
} from "@bitwarden/auth/common";
|
} from "@bitwarden/auth/common";
|
||||||
import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction";
|
import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction";
|
||||||
import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||||
@@ -20,7 +19,6 @@ import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/mod
|
|||||||
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
||||||
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
||||||
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
||||||
import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login.service.abstraction";
|
|
||||||
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
||||||
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
||||||
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
||||||
@@ -71,8 +69,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
formValidationErrorService: FormValidationErrorsService,
|
formValidationErrorService: FormValidationErrorsService,
|
||||||
loginEmailService: LoginEmailServiceAbstraction,
|
loginEmailService: LoginEmailServiceAbstraction,
|
||||||
ssoLoginService: SsoLoginServiceAbstraction,
|
ssoLoginService: SsoLoginServiceAbstraction,
|
||||||
webAuthnLoginService: WebAuthnLoginServiceAbstraction,
|
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
toastService: ToastService,
|
toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
@@ -93,8 +89,6 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
route,
|
route,
|
||||||
loginEmailService,
|
loginEmailService,
|
||||||
ssoLoginService,
|
ssoLoginService,
|
||||||
webAuthnLoginService,
|
|
||||||
registerRouteService,
|
|
||||||
toastService,
|
toastService,
|
||||||
);
|
);
|
||||||
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
|
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
|
||||||
@@ -111,7 +105,7 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
|
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
|
||||||
this.route.queryParams.pipe(first()).subscribe(async (qParams) => {
|
this.route.queryParams.pipe(first()).subscribe(async (qParams) => {
|
||||||
// If there is an query parameter called 'org', set previousUrl to `/create-organization?org=paramValue`
|
// If there is a query parameter called 'org', set previousUrl to `/create-organization?org=paramValue`
|
||||||
if (qParams.org != null) {
|
if (qParams.org != null) {
|
||||||
const route = this.router.createUrlTree(["create-organization"], {
|
const route = this.router.createUrlTree(["create-organization"], {
|
||||||
queryParams: { plan: qParams.org },
|
queryParams: { plan: qParams.org },
|
||||||
@@ -178,17 +172,14 @@ export class LoginComponentV1 extends BaseLoginComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async goToRegister() {
|
async goToRegister() {
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
const registerRoute = await firstValueFrom(this.registerRoute$);
|
|
||||||
|
|
||||||
if (this.emailFormControl.valid) {
|
if (this.emailFormControl.valid) {
|
||||||
await this.router.navigate([registerRoute], {
|
await this.router.navigate(["/signup"], {
|
||||||
queryParams: { email: this.emailFormControl.value },
|
queryParams: { email: this.emailFormControl.value },
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.router.navigate([registerRoute]);
|
await this.router.navigate(["/signup"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async handleMigrateEncryptionKey(result: AuthResult): Promise<boolean> {
|
protected override async handleMigrateEncryptionKey(result: AuthResult): Promise<boolean> {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ActivatedRoute, Params, Router } from "@angular/router";
|
import { ActivatedRoute, Params, Router } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
|
||||||
|
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
@@ -27,10 +25,9 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
|||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
private acceptOrganizationInviteService: AcceptOrganizationInviteService,
|
private acceptOrganizationInviteService: AcceptOrganizationInviteService,
|
||||||
) {
|
) {
|
||||||
super(router, platformUtilsService, i18nService, route, authService, registerRouteService);
|
super(router, platformUtilsService, i18nService, route, authService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async authedHandler(qParams: Params): Promise<void> {
|
async authedHandler(qParams: Params): Promise<void> {
|
||||||
@@ -55,6 +52,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
|||||||
|
|
||||||
async unauthedHandler(qParams: Params): Promise<void> {
|
async unauthedHandler(qParams: Params): Promise<void> {
|
||||||
const invite = OrganizationInvite.fromParams(qParams);
|
const invite = OrganizationInvite.fromParams(qParams);
|
||||||
|
|
||||||
await this.acceptOrganizationInviteService.setOrganizationInvitation(invite);
|
await this.acceptOrganizationInviteService.setOrganizationInvitation(invite);
|
||||||
await this.navigateInviteAcceptance(invite);
|
await this.navigateInviteAcceptance(invite);
|
||||||
}
|
}
|
||||||
@@ -86,25 +84,12 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
|||||||
// if SSO is disabled OR if sso is enabled but the SSO login required policy is not enabled
|
// if SSO is disabled OR if sso is enabled but the SSO login required policy is not enabled
|
||||||
// then send user to create account
|
// then send user to create account
|
||||||
|
|
||||||
// TODO: update logic when email verification flag is removed
|
// We don't need users to complete email verification if they are coming directly from an emailed invite.
|
||||||
let queryParams: Params;
|
// Therefore, we skip /signup and navigate directly to /finish-signup.
|
||||||
let registerRoute = await firstValueFrom(this.registerRoute$);
|
await this.router.navigate(["/finish-signup"], {
|
||||||
if (registerRoute === "/register") {
|
queryParams: {
|
||||||
queryParams = {
|
|
||||||
fromOrgInvite: "true",
|
|
||||||
email: invite.email,
|
email: invite.email,
|
||||||
};
|
},
|
||||||
} else if (registerRoute === "/signup") {
|
|
||||||
// We have to override the base component route as we don't need users to complete email verification
|
|
||||||
// if they are coming directly from an emailed org invite.
|
|
||||||
registerRoute = "/finish-signup";
|
|
||||||
queryParams = {
|
|
||||||
email: invite.email,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.router.navigate([registerRoute], {
|
|
||||||
queryParams: queryParams,
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ActivatedRoute, Params, Router } from "@angular/router";
|
|||||||
import { Subject, firstValueFrom } from "rxjs";
|
import { Subject, firstValueFrom } from "rxjs";
|
||||||
import { first, switchMap, takeUntil } from "rxjs/operators";
|
import { first, switchMap, takeUntil } from "rxjs/operators";
|
||||||
|
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
@@ -22,9 +21,6 @@ export abstract class BaseAcceptComponent implements OnInit {
|
|||||||
protected failedShortMessage = "inviteAcceptFailedShort";
|
protected failedShortMessage = "inviteAcceptFailedShort";
|
||||||
protected failedMessage = "inviteAcceptFailed";
|
protected failedMessage = "inviteAcceptFailed";
|
||||||
|
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
|
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -33,10 +29,10 @@ export abstract class BaseAcceptComponent implements OnInit {
|
|||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
protected registerRouteService: RegisterRouteService,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
abstract authedHandler(qParams: Params): Promise<void>;
|
abstract authedHandler(qParams: Params): Promise<void>;
|
||||||
|
|
||||||
abstract unauthedHandler(qParams: Params): Promise<void>;
|
abstract unauthedHandler(qParams: Params): Promise<void>;
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import {
|
|||||||
tdeDecryptionRequiredGuard,
|
tdeDecryptionRequiredGuard,
|
||||||
unauthGuardFn,
|
unauthGuardFn,
|
||||||
} from "@bitwarden/angular/auth/guards";
|
} from "@bitwarden/angular/auth/guards";
|
||||||
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
|
|
||||||
import { generatorSwap } from "@bitwarden/angular/tools/generator/generator-swap";
|
import { generatorSwap } from "@bitwarden/angular/tools/generator/generator-swap";
|
||||||
|
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
|
||||||
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
|
||||||
import {
|
import {
|
||||||
AnonLayoutWrapperComponent,
|
AnonLayoutWrapperComponent,
|
||||||
@@ -38,7 +38,6 @@ import {
|
|||||||
VaultIcon,
|
VaultIcon,
|
||||||
LoginDecryptionOptionsComponent,
|
LoginDecryptionOptionsComponent,
|
||||||
} from "@bitwarden/auth/angular";
|
} from "@bitwarden/auth/angular";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { LockComponent } from "@bitwarden/key-management/angular";
|
import { LockComponent } from "@bitwarden/key-management/angular";
|
||||||
import {
|
import {
|
||||||
NewDeviceVerificationNoticePageOneComponent,
|
NewDeviceVerificationNoticePageOneComponent,
|
||||||
@@ -46,7 +45,6 @@ import {
|
|||||||
VaultIcons,
|
VaultIcons,
|
||||||
} from "@bitwarden/vault";
|
} from "@bitwarden/vault";
|
||||||
|
|
||||||
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";
|
||||||
|
|
||||||
import { VerifyRecoverDeleteOrgComponent } from "./admin-console/organizations/manage/verify-recover-delete-org.component";
|
import { VerifyRecoverDeleteOrgComponent } from "./admin-console/organizations/manage/verify-recover-delete-org.component";
|
||||||
@@ -71,7 +69,6 @@ import { SecurityRoutingModule } from "./auth/settings/security/security-routing
|
|||||||
import { SsoComponentV1 } from "./auth/sso-v1.component";
|
import { SsoComponentV1 } from "./auth/sso-v1.component";
|
||||||
import { CompleteTrialInitiationComponent } from "./auth/trial-initiation/complete-trial-initiation/complete-trial-initiation.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 { 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 { TwoFactorAuthComponent } from "./auth/two-factor-auth.component";
|
||||||
import { TwoFactorComponent } from "./auth/two-factor.component";
|
import { TwoFactorComponent } from "./auth/two-factor.component";
|
||||||
import { UpdatePasswordComponent } from "./auth/update-password.component";
|
import { UpdatePasswordComponent } from "./auth/update-password.component";
|
||||||
@@ -96,6 +93,18 @@ import { SendComponent } from "./tools/send/send.component";
|
|||||||
import { VaultModule } from "./vault/individual-vault/vault.module";
|
import { VaultModule } from "./vault/individual-vault/vault.module";
|
||||||
|
|
||||||
const routes: Routes = [
|
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: "",
|
path: "",
|
||||||
component: FrontendLayoutComponent,
|
component: FrontendLayoutComponent,
|
||||||
@@ -112,20 +121,6 @@ const routes: Routes = [
|
|||||||
component: LoginViaWebAuthnComponent,
|
component: LoginViaWebAuthnComponent,
|
||||||
data: { titleId: "logInWithPasskey" } satisfies RouteDataProperties,
|
data: { titleId: "logInWithPasskey" } satisfies RouteDataProperties,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "register",
|
|
||||||
component: TrialInitiationComponent,
|
|
||||||
canActivate: [
|
|
||||||
canAccessFeature(FeatureFlag.EmailVerification, false, "/signup", false),
|
|
||||||
unauthGuardFn(),
|
|
||||||
],
|
|
||||||
data: { titleId: "createAccount" } satisfies RouteDataProperties,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "trial",
|
|
||||||
redirectTo: "register",
|
|
||||||
pathMatch: "full",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "set-password",
|
path: "set-password",
|
||||||
component: SetPasswordComponent,
|
component: SetPasswordComponent,
|
||||||
@@ -347,7 +342,7 @@ const routes: Routes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "signup",
|
path: "signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationUserAddIcon,
|
pageIcon: RegistrationUserAddIcon,
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
@@ -372,7 +367,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "finish-signup",
|
path: "finish-signup",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationLockAltIcon,
|
pageIcon: RegistrationLockAltIcon,
|
||||||
titleId: "setAStrongPassword",
|
titleId: "setAStrongPassword",
|
||||||
@@ -406,7 +401,6 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "set-password-jit",
|
path: "set-password-jit",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification)],
|
|
||||||
component: SetPasswordJitComponent,
|
component: SetPasswordJitComponent,
|
||||||
data: {
|
data: {
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
@@ -419,7 +413,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "signup-link-expired",
|
path: "signup-link-expired",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
data: {
|
data: {
|
||||||
pageIcon: RegistrationExpiredLinkIcon,
|
pageIcon: RegistrationExpiredLinkIcon,
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
@@ -656,7 +650,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "trial-initiation",
|
path: "trial-initiation",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
component: CompleteTrialInitiationComponent,
|
component: CompleteTrialInitiationComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
pageTitle: freeTrialTextResolver,
|
pageTitle: freeTrialTextResolver,
|
||||||
@@ -667,7 +661,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "secrets-manager-trial-initiation",
|
path: "secrets-manager-trial-initiation",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()],
|
canActivate: [unauthGuardFn()],
|
||||||
component: CompleteTrialInitiationComponent,
|
component: CompleteTrialInitiationComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
pageTitle: freeTrialTextResolver,
|
pageTitle: freeTrialTextResolver,
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ import { FormBuilder } from "@angular/forms";
|
|||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
|
|
||||||
import { AnonLayoutWrapperDataService } from "@bitwarden/auth/angular";
|
import { AnonLayoutWrapperDataService } from "@bitwarden/auth/angular";
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
|
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
|
||||||
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
@@ -58,9 +56,6 @@ export class AccessComponent implements OnInit {
|
|||||||
|
|
||||||
protected formGroup = this.formBuilder.group({});
|
protected formGroup = this.formBuilder.group({});
|
||||||
|
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
|
|
||||||
private id: string;
|
private id: string;
|
||||||
private key: string;
|
private key: string;
|
||||||
|
|
||||||
@@ -71,8 +66,6 @@ export class AccessComponent implements OnInit {
|
|||||||
private sendApiService: SendApiService,
|
private sendApiService: SendApiService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private configService: ConfigService,
|
|
||||||
private registerRouteService: RegisterRouteService,
|
|
||||||
private layoutWrapperDataService: AnonLayoutWrapperDataService,
|
private layoutWrapperDataService: AnonLayoutWrapperDataService,
|
||||||
protected formBuilder: FormBuilder,
|
protected formBuilder: FormBuilder,
|
||||||
) {}
|
) {}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
>Bitwarden Send</a
|
>Bitwarden Send</a
|
||||||
>
|
>
|
||||||
{{ "sendAccessTaglineOr" | i18n }}
|
{{ "sendAccessTaglineOr" | i18n }}
|
||||||
<a bitLink [routerLink]="registerRoute$ | async" target="_blank" rel="noreferrer">{{
|
<a bitLink routerLink="/signup" target="_blank" rel="noreferrer">{{
|
||||||
"sendAccessTaglineSignUp" | i18n
|
"sendAccessTaglineSignUp" | i18n
|
||||||
}}</a>
|
}}</a>
|
||||||
{{ "sendAccessTaglineTryToday" | i18n }}
|
{{ "sendAccessTaglineTryToday" | i18n }}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
|
|
||||||
import { SharedModule } from "../../shared";
|
import { SharedModule } from "../../shared";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -11,7 +9,5 @@ import { SharedModule } from "../../shared";
|
|||||||
imports: [SharedModule],
|
imports: [SharedModule],
|
||||||
})
|
})
|
||||||
export class SendAccessExplainerComponent {
|
export class SendAccessExplainerComponent {
|
||||||
// TODO: remove when email verification flag is removed
|
constructor() {}
|
||||||
registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
constructor(private registerRouteService: RegisterRouteService) {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ActivatedRoute, Params, Router } from "@angular/router";
|
import { ActivatedRoute, Params, Router } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
|
||||||
|
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { ProviderUserAcceptRequest } from "@bitwarden/common/admin-console/models/request/provider/provider-user-accept.request";
|
import { ProviderUserAcceptRequest } from "@bitwarden/common/admin-console/models/request/provider/provider-user-accept.request";
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
@@ -33,9 +31,8 @@ export class AcceptProviderComponent extends BaseAcceptComponent {
|
|||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
platformUtilService: PlatformUtilsService,
|
platformUtilService: PlatformUtilsService,
|
||||||
registerRouteService: RegisterRouteService,
|
|
||||||
) {
|
) {
|
||||||
super(router, platformUtilService, i18nService, route, authService, registerRouteService);
|
super(router, platformUtilService, i18nService, route, authService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async authedHandler(qParams: Params) {
|
async authedHandler(qParams: Params) {
|
||||||
@@ -47,6 +44,7 @@ export class AcceptProviderComponent extends BaseAcceptComponent {
|
|||||||
qParams.providerUserId,
|
qParams.providerUserId,
|
||||||
request,
|
request,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.platformUtilService.showToast(
|
this.platformUtilService.showToast(
|
||||||
"success",
|
"success",
|
||||||
this.i18nService.t("inviteAccepted"),
|
this.i18nService.t("inviteAccepted"),
|
||||||
@@ -64,25 +62,14 @@ export class AcceptProviderComponent extends BaseAcceptComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async register() {
|
async register() {
|
||||||
let queryParams: Params;
|
// We don't need users to complete email verification if they are coming directly from an emailed invite.
|
||||||
let registerRoute = await firstValueFrom(this.registerRoute$);
|
// Therefore, we skip /signup and navigate directly to /finish-signup.
|
||||||
if (registerRoute === "/register") {
|
await this.router.navigate(["/finish-signup"], {
|
||||||
queryParams = {
|
queryParams: {
|
||||||
email: this.email,
|
|
||||||
};
|
|
||||||
} else if (registerRoute === "/signup") {
|
|
||||||
// We have to override the base component route as we don't need users to
|
|
||||||
// complete email verification if they are coming directly an emailed invite.
|
|
||||||
registerRoute = "/finish-signup";
|
|
||||||
queryParams = {
|
|
||||||
email: this.email,
|
email: this.email,
|
||||||
providerUserId: this.providerUserId,
|
providerUserId: this.providerUserId,
|
||||||
providerInviteToken: this.providerInviteToken,
|
providerInviteToken: this.providerInviteToken,
|
||||||
};
|
},
|
||||||
}
|
|
||||||
|
|
||||||
await this.router.navigate([registerRoute], {
|
|
||||||
queryParams: queryParams,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,9 @@ import {
|
|||||||
LoginStrategyServiceAbstraction,
|
LoginStrategyServiceAbstraction,
|
||||||
LoginEmailServiceAbstraction,
|
LoginEmailServiceAbstraction,
|
||||||
PasswordLoginCredentials,
|
PasswordLoginCredentials,
|
||||||
RegisterRouteService,
|
|
||||||
} from "@bitwarden/auth/common";
|
} from "@bitwarden/auth/common";
|
||||||
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction";
|
||||||
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
||||||
import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login.service.abstraction";
|
|
||||||
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
||||||
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
|
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
|
||||||
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
|
||||||
@@ -56,7 +54,7 @@ export class LoginComponentV1 extends CaptchaProtectedComponent implements OnIni
|
|||||||
return this.formGroup.controls.email;
|
return this.formGroup.controls.email;
|
||||||
}
|
}
|
||||||
|
|
||||||
formGroup = this.formBuilder.group({
|
formGroup = this.formBuilder.nonNullable.group({
|
||||||
email: ["", [Validators.required, Validators.email]],
|
email: ["", [Validators.required, Validators.email]],
|
||||||
masterPassword: [
|
masterPassword: [
|
||||||
"",
|
"",
|
||||||
@@ -67,14 +65,12 @@ export class LoginComponentV1 extends CaptchaProtectedComponent implements OnIni
|
|||||||
|
|
||||||
protected twoFactorRoute = "2fa";
|
protected twoFactorRoute = "2fa";
|
||||||
protected successRoute = "vault";
|
protected successRoute = "vault";
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
protected registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
protected forcePasswordResetRoute = "update-temp-password";
|
protected forcePasswordResetRoute = "update-temp-password";
|
||||||
|
|
||||||
protected destroy$ = new Subject<void>();
|
protected destroy$ = new Subject<void>();
|
||||||
|
|
||||||
get loggedEmail() {
|
get loggedEmail() {
|
||||||
return this.formGroup.value.email;
|
return this.formGroup.controls.email.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -95,8 +91,6 @@ export class LoginComponentV1 extends CaptchaProtectedComponent implements OnIni
|
|||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected loginEmailService: LoginEmailServiceAbstraction,
|
protected loginEmailService: LoginEmailServiceAbstraction,
|
||||||
protected ssoLoginService: SsoLoginServiceAbstraction,
|
protected ssoLoginService: SsoLoginServiceAbstraction,
|
||||||
protected webAuthnLoginService: WebAuthnLoginServiceAbstraction,
|
|
||||||
protected registerRouteService: RegisterRouteService,
|
|
||||||
protected toastService: ToastService,
|
protected toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
super(environmentService, i18nService, platformUtilsService, toastService);
|
super(environmentService, i18nService, platformUtilsService, toastService);
|
||||||
@@ -146,8 +140,6 @@ export class LoginComponentV1 extends CaptchaProtectedComponent implements OnIni
|
|||||||
}
|
}
|
||||||
|
|
||||||
async submit(showToast = true) {
|
async submit(showToast = true) {
|
||||||
const data = this.formGroup.value;
|
|
||||||
|
|
||||||
await this.setupCaptcha();
|
await this.setupCaptcha();
|
||||||
|
|
||||||
this.formGroup.markAllAsTouched();
|
this.formGroup.markAllAsTouched();
|
||||||
@@ -170,10 +162,10 @@ export class LoginComponentV1 extends CaptchaProtectedComponent implements OnIni
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const credentials = new PasswordLoginCredentials(
|
const credentials = new PasswordLoginCredentials(
|
||||||
data.email,
|
this.formGroup.controls.email.value,
|
||||||
data.masterPassword,
|
this.formGroup.controls.masterPassword.value,
|
||||||
this.captchaToken,
|
this.captchaToken,
|
||||||
null,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.formPromise = this.loginStrategyService.logIn(credentials);
|
this.formPromise = this.loginStrategyService.logIn(credentials);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/
|
|||||||
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
||||||
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
|
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
|
||||||
import { SsoPreValidateResponse } from "@bitwarden/common/auth/models/response/sso-pre-validate.response";
|
import { SsoPreValidateResponse } from "@bitwarden/common/auth/models/response/sso-pre-validate.response";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
||||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
@@ -50,7 +49,7 @@ export class SsoComponent implements OnInit {
|
|||||||
protected twoFactorRoute = "2fa";
|
protected twoFactorRoute = "2fa";
|
||||||
protected successRoute = "lock";
|
protected successRoute = "lock";
|
||||||
protected trustedDeviceEncRoute = "login-initiated";
|
protected trustedDeviceEncRoute = "login-initiated";
|
||||||
protected changePasswordRoute = "set-password";
|
protected changePasswordRoute = "set-password-jit";
|
||||||
protected forcePasswordResetRoute = "update-temp-password";
|
protected forcePasswordResetRoute = "update-temp-password";
|
||||||
protected clientId: string;
|
protected clientId: string;
|
||||||
protected redirectUri: string;
|
protected redirectUri: string;
|
||||||
@@ -339,14 +338,6 @@ export class SsoComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleChangePasswordRequired(orgIdentifier: string) {
|
private async handleChangePasswordRequired(orgIdentifier: string) {
|
||||||
const emailVerification = await this.configService.getFeatureFlag(
|
|
||||||
FeatureFlag.EmailVerification,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (emailVerification) {
|
|
||||||
this.changePasswordRoute = "set-password-jit";
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.navigateViaCallbackOrRoute(
|
await this.navigateViaCallbackOrRoute(
|
||||||
this.onSuccessfulLoginChangePasswordNavigate,
|
this.onSuccessfulLoginChangePasswordNavigate,
|
||||||
[this.changePasswordRoute],
|
[this.changePasswordRoute],
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
UserDecryptionOptionsService,
|
UserDecryptionOptionsService,
|
||||||
UserDecryptionOptionsServiceAbstraction,
|
UserDecryptionOptionsServiceAbstraction,
|
||||||
LogoutReason,
|
LogoutReason,
|
||||||
RegisterRouteService,
|
|
||||||
AuthRequestApiService,
|
AuthRequestApiService,
|
||||||
DefaultAuthRequestApiService,
|
DefaultAuthRequestApiService,
|
||||||
DefaultLoginSuccessHandlerService,
|
DefaultLoginSuccessHandlerService,
|
||||||
@@ -1354,11 +1353,6 @@ const safeProviders: SafeProvider[] = [
|
|||||||
useClass: DefaultServerSettingsService,
|
useClass: DefaultServerSettingsService,
|
||||||
deps: [ConfigService],
|
deps: [ConfigService],
|
||||||
}),
|
}),
|
||||||
safeProvider({
|
|
||||||
provide: RegisterRouteService,
|
|
||||||
useClass: RegisterRouteService,
|
|
||||||
deps: [ConfigService],
|
|
||||||
}),
|
|
||||||
safeProvider({
|
safeProvider({
|
||||||
provide: AnonLayoutWrapperDataService,
|
provide: AnonLayoutWrapperDataService,
|
||||||
useClass: DefaultAnonLayoutWrapperDataService,
|
useClass: DefaultAnonLayoutWrapperDataService,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { Component, inject } from "@angular/core";
|
|||||||
import { RouterModule } from "@angular/router";
|
import { RouterModule } from "@angular/router";
|
||||||
|
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import { RegisterRouteService } from "@bitwarden/auth/common";
|
|
||||||
import { DefaultServerSettingsService } from "@bitwarden/common/platform/services/default-server-settings.service";
|
import { DefaultServerSettingsService } from "@bitwarden/common/platform/services/default-server-settings.service";
|
||||||
import { LinkModule } from "@bitwarden/components";
|
import { LinkModule } from "@bitwarden/components";
|
||||||
|
|
||||||
@@ -13,16 +12,12 @@ import { LinkModule } from "@bitwarden/components";
|
|||||||
template: `
|
template: `
|
||||||
<div class="tw-text-center" *ngIf="!(isUserRegistrationDisabled$ | async)">
|
<div class="tw-text-center" *ngIf="!(isUserRegistrationDisabled$ | async)">
|
||||||
{{ "newToBitwarden" | i18n }}
|
{{ "newToBitwarden" | i18n }}
|
||||||
<a bitLink [routerLink]="registerRoute$ | async">{{ "createAccount" | i18n }}</a>
|
<a bitLink routerLink="/signup">{{ "createAccount" | i18n }}</a>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class LoginSecondaryContentComponent {
|
export class LoginSecondaryContentComponent {
|
||||||
registerRouteService = inject(RegisterRouteService);
|
|
||||||
serverSettingsService = inject(DefaultServerSettingsService);
|
serverSettingsService = inject(DefaultServerSettingsService);
|
||||||
|
|
||||||
// TODO: remove when email verification flag is removed
|
|
||||||
protected registerRoute$ = this.registerRouteService.registerRoute$();
|
|
||||||
|
|
||||||
protected isUserRegistrationDisabled$ = this.serverSettingsService.isUserRegistrationDisabled$;
|
protected isUserRegistrationDisabled$ = this.serverSettingsService.isUserRegistrationDisabled$;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -480,16 +480,7 @@ export class SsoComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleChangePasswordRequired(orgIdentifier: string) {
|
private async handleChangePasswordRequired(orgIdentifier: string) {
|
||||||
const emailVerification = await this.configService.getFeatureFlag(
|
await this.router.navigate(["set-password-jit"], {
|
||||||
FeatureFlag.EmailVerification,
|
|
||||||
);
|
|
||||||
|
|
||||||
let route = "set-password";
|
|
||||||
if (emailVerification) {
|
|
||||||
route = "set-password-jit";
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.router.navigate([route], {
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
identifier: orgIdentifier,
|
identifier: orgIdentifier,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,5 @@ export * from "./login-strategies/login-strategy.service";
|
|||||||
export * from "./user-decryption-options/user-decryption-options.service";
|
export * from "./user-decryption-options/user-decryption-options.service";
|
||||||
export * from "./auth-request/auth-request.service";
|
export * from "./auth-request/auth-request.service";
|
||||||
export * from "./auth-request/auth-request-api.service";
|
export * from "./auth-request/auth-request-api.service";
|
||||||
export * from "./register-route.service";
|
|
||||||
export * from "./accounts/lock.service";
|
export * from "./accounts/lock.service";
|
||||||
export * from "./login-success-handler/default-login-success-handler.service";
|
export * from "./login-success-handler/default-login-success-handler.service";
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import { Observable, map } from "rxjs";
|
|
||||||
|
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
|
||||||
|
|
||||||
// This is a temporary service to determine the correct route to use for registration based on the email verification feature flag.
|
|
||||||
export class RegisterRouteService {
|
|
||||||
constructor(private configService: ConfigService) {}
|
|
||||||
|
|
||||||
registerRoute$(): Observable<string> {
|
|
||||||
return this.configService.getFeatureFlag$(FeatureFlag.EmailVerification).pipe(
|
|
||||||
map((emailVerificationEnabled) => {
|
|
||||||
if (emailVerificationEnabled) {
|
|
||||||
return "/signup";
|
|
||||||
} else {
|
|
||||||
return "/register";
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,7 +23,6 @@ export enum FeatureFlag {
|
|||||||
ExtensionRefresh = "extension-refresh",
|
ExtensionRefresh = "extension-refresh",
|
||||||
PersistPopupView = "persist-popup-view",
|
PersistPopupView = "persist-popup-view",
|
||||||
PM4154_BulkEncryptionService = "PM-4154-bulk-encryption-service",
|
PM4154_BulkEncryptionService = "PM-4154-bulk-encryption-service",
|
||||||
EmailVerification = "email-verification",
|
|
||||||
TwoFactorComponentRefactor = "two-factor-component-refactor",
|
TwoFactorComponentRefactor = "two-factor-component-refactor",
|
||||||
ProviderClientVaultPrivacyBanner = "ac-2833-provider-client-vault-privacy-banner",
|
ProviderClientVaultPrivacyBanner = "ac-2833-provider-client-vault-privacy-banner",
|
||||||
VaultBulkManagementAction = "vault-bulk-management-action",
|
VaultBulkManagementAction = "vault-bulk-management-action",
|
||||||
@@ -78,7 +77,6 @@ export const DefaultFeatureFlagValue = {
|
|||||||
[FeatureFlag.ExtensionRefresh]: FALSE,
|
[FeatureFlag.ExtensionRefresh]: FALSE,
|
||||||
[FeatureFlag.PersistPopupView]: FALSE,
|
[FeatureFlag.PersistPopupView]: FALSE,
|
||||||
[FeatureFlag.PM4154_BulkEncryptionService]: FALSE,
|
[FeatureFlag.PM4154_BulkEncryptionService]: FALSE,
|
||||||
[FeatureFlag.EmailVerification]: FALSE,
|
|
||||||
[FeatureFlag.TwoFactorComponentRefactor]: FALSE,
|
[FeatureFlag.TwoFactorComponentRefactor]: FALSE,
|
||||||
[FeatureFlag.ProviderClientVaultPrivacyBanner]: FALSE,
|
[FeatureFlag.ProviderClientVaultPrivacyBanner]: FALSE,
|
||||||
[FeatureFlag.VaultBulkManagementAction]: FALSE,
|
[FeatureFlag.VaultBulkManagementAction]: FALSE,
|
||||||
|
|||||||
Reference in New Issue
Block a user