diff --git a/apps/web/src/app/auth/core/services/login/web-login.service.ts b/apps/web/src/app/auth/core/services/login/web-login.service.ts index 48ae39a840..6af1d4f041 100644 --- a/apps/web/src/app/auth/core/services/login/web-login.service.ts +++ b/apps/web/src/app/auth/core/services/login/web-login.service.ts @@ -8,6 +8,7 @@ import { InternalPolicyService } from "@bitwarden/common/admin-console/abstracti import { Policy } from "@bitwarden/common/admin-console/models/domain/policy"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; +import { flagEnabled } from "../../../../../utils/flags"; import { RouterService } from "../../../../core/router.service"; import { AcceptOrganizationInviteService } from "../../../organization-invite/accept-organization.service"; @@ -18,6 +19,10 @@ export class WebLoginService extends DefaultLoginService implements LoginService policyService = inject(InternalPolicyService); routerService = inject(RouterService); + getShowPasswordlessFlag(): boolean { + return flagEnabled("showPasswordless"); + } + setPreviousUrl(route: UrlTree): void | null { this.routerService.setPreviousUrl(route.toString()); } diff --git a/libs/auth/src/angular/login/default-login.service.ts b/libs/auth/src/angular/login/default-login.service.ts index f3a4c36d2e..5874d57c5b 100644 --- a/libs/auth/src/angular/login/default-login.service.ts +++ b/libs/auth/src/angular/login/default-login.service.ts @@ -3,6 +3,10 @@ import { UrlTree } from "@angular/router"; import { LoginService, PasswordPolicies } from "./login.service"; export class DefaultLoginService implements LoginService { + getShowPasswordlessFlag(): boolean { + return null; + } + setPreviousUrl(route: UrlTree): void | null { return null; } diff --git a/libs/auth/src/angular/login/login.component.html b/libs/auth/src/angular/login/login.component.html index 31ad27f000..c12dcedb71 100644 --- a/libs/auth/src/angular/login/login.component.html +++ b/libs/auth/src/angular/login/login.component.html @@ -2,7 +2,7 @@ - +
@@ -69,4 +69,63 @@ + +
+ + {{ "masterPass" | i18n }} + + + + {{ "getMasterPasswordHint" | i18n }} +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+

{{ "loggingInAs" | i18n }} {{ loggedEmail }}

+ {{ "notYou" | i18n }} +
+
diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index a5301a3545..a59907eb1f 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -66,6 +66,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy { // Web specific properties enforcedPasswordPolicyOptions: MasterPasswordPolicyOptions; policies: Policy[]; + showPasswordless = false; showResetPasswordAutoEnrollWarning = false; constructor( @@ -81,6 +82,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy { private router: Router, ) { this.clientType = this.platformUtilsService.getClientType(); + this.showPasswordless = this.loginService.getShowPasswordlessFlag(); } async ngOnInit(): Promise { @@ -158,6 +160,11 @@ export class LoginComponentV2 implements OnInit, OnDestroy { } } + protected async goToHint() { + await this.saveEmailSettings(); + await this.router.navigateByUrl("/hint"); + } + protected async goToRegister() { // TODO: remove when email verification flag is removed const registerRoute = await firstValueFrom(this.registerRoute$); @@ -172,6 +179,12 @@ export class LoginComponentV2 implements OnInit, OnDestroy { await this.router.navigate([registerRoute]); } + protected async saveEmailSettings() { + this.loginEmailService.setEmail(this.formGroup.value.email); + this.loginEmailService.setRememberEmail(this.formGroup.value.rememberEmail); + await this.loginEmailService.saveEmailSettings(); + } + private async getLoginWithDevice(email: string): Promise { try { const deviceIdentifier = await this.appIdService.getAppId(); diff --git a/libs/auth/src/angular/login/login.service.ts b/libs/auth/src/angular/login/login.service.ts index b2b68c9c47..9c9e59d5dd 100644 --- a/libs/auth/src/angular/login/login.service.ts +++ b/libs/auth/src/angular/login/login.service.ts @@ -11,6 +11,7 @@ export interface PasswordPolicies { export abstract class LoginService { // Web specific + getShowPasswordlessFlag: () => boolean; getOrgPolicies: () => Promise; setPreviousUrl: (route: UrlTree) => void | null; }