diff options
| author | 2020-12-22 17:36:50 +0100 | |
|---|---|---|
| committer | 2020-12-22 17:36:50 +0100 | |
| commit | 48e0464e4bf70a240d6c829bc3e9434ecc04ec42 (patch) | |
| tree | 28f26a1dc62546440c551b89d28a82b2e610ba35 | |
| parent | 98b82842d58579832f0687127218cd272a7ad636 (diff) | |
Prevent login before extra.js is loaded (#3275)
Disable submit button until extra.js with its crypto functions is
loaded.
| -rw-r--r-- | app/views/auth/formLogin.phtml | 2 | ||||
| -rw-r--r-- | p/scripts/extra.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml index dfff64ffb..b5fee2c27 100644 --- a/app/views/auth/formLogin.phtml +++ b/app/views/auth/formLogin.phtml @@ -31,7 +31,7 @@ </div> <div class="form-group form-group-actions"> - <button id="loginButton" type="submit" class="btn btn-important"> + <button id="loginButton" type="submit" class="btn btn-important" disabled="disabled"> <?= _t('gen.auth.login') ?> </button> </div> diff --git a/p/scripts/extra.js b/p/scripts/extra.js index d34042e05..4d4f3f171 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -51,8 +51,10 @@ function init_crypto_form() { forgetOpenCategories(); + const submit_button = document.querySelector('button[type="submit"]'); + submit_button.disabled = false; + crypto_form.onsubmit = function (e) { - const submit_button = this.querySelector('button[type="submit"]'); submit_button.disabled = true; let success = false; |
