From 603a7ffed7917dbded2bc30a1f7ca204afd6b815 Mon Sep 17 00:00:00 2001 From: sebadob Date: Wed, 25 Oct 2023 09:28:58 +0200 Subject: [PATCH] better UX when using a password manager on login form --- frontend/src/routes/oidc/authorize/+page.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/oidc/authorize/+page.svelte b/frontend/src/routes/oidc/authorize/+page.svelte index cff7e8c4..417f377f 100644 --- a/frontend/src/routes/oidc/authorize/+page.svelte +++ b/frontend/src/routes/oidc/authorize/+page.svelte @@ -44,6 +44,7 @@ let showReset = false; let showResetRequest = false; let emailSuccess = false; + let emailAfterSubmit = ''; let formValues = {email: '', password: ''}; let formErrors = {}; @@ -175,6 +176,7 @@ // this will happen always if the user does the first try with a password-only account // the good thing about this is, that it is a prevention against autofill passwords from the browser needsPassword = true; + emailAfterSubmit = formValues.email; } else { err = t.invalidCredentials; showResetRequest = true; @@ -185,7 +187,7 @@ function onEmailInput() { // this will basically remove the password input again if the user was asked to provide // a password and afterward changes his email again - if (needsPassword) { + if (needsPassword && emailAfterSubmit !== formValues.email) { needsPassword = false; } }