From 48e0464e4bf70a240d6c829bc3e9434ecc04ec42 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 22 Dec 2020 17:36:50 +0100 Subject: Prevent login before extra.js is loaded (#3275) Disable submit button until extra.js with its crypto functions is loaded. --- app/views/auth/formLogin.phtml | 2 +- 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 @@
-
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; -- cgit v1.2.3