From fabc15fa459cc07148464fd88a1c1fdd5a284dde Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Mon, 27 Feb 2023 10:33:06 -0500 Subject: [PATCH] PM-187 - Allow autofill to work on web vault two step login page by rendering the password form in a hidden state and preventing the continue button from wiping out the autofilled password (#4844) --- apps/web/src/auth/login/login.component.html | 136 ++++++++++-------- .../src/auth/components/login.component.ts | 6 +- 2 files changed, 78 insertions(+), 64 deletions(-) diff --git a/apps/web/src/auth/login/login.component.html b/apps/web/src/auth/login/login.component.html index 86d8526d8bb..22f92cc01c2 100644 --- a/apps/web/src/auth/login/login.component.html +++ b/apps/web/src/auth/login/login.component.html @@ -16,7 +16,7 @@
- +
{{ "emailAddress" | i18n }} @@ -59,69 +59,79 @@ {{ "createAccount" | i18n }}

+ +
+
+ + {{ "masterPass" | i18n }} + + + + {{ "getMasterPasswordHint" | i18n }} +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+

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

+ {{ "notYou" | i18n }} +
+
- - -
- - {{ "masterPass" | i18n }} - - - - {{ - "getMasterPasswordHint" | i18n - }} -
- -
- -
- -
- -
- -
- -
- -
- - - {{ "enterpriseSingleSignOn" | i18n }} - -
- -
- -
-

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

- {{ "notYou" | i18n }} -
-
diff --git a/libs/angular/src/auth/components/login.component.ts b/libs/angular/src/auth/components/login.component.ts index 88c0a356fa8..10ff0521870 100644 --- a/libs/angular/src/auth/components/login.component.ts +++ b/libs/angular/src/auth/components/login.component.ts @@ -238,7 +238,11 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit toggleValidateEmail(value: boolean) { this.validatedEmail = value; - this.formGroup.controls.masterPassword.reset(); + if (!value) { + // Reset master password only when going from validated to not validated (not you btn press) + // so that autofill can work properly + this.formGroup.controls.masterPassword.reset(); + } } setFormValues() {