From c5b51e8969ce8519733addad82398a482eb208f5 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 13 Nov 2023 09:31:42 +0100 Subject: [PATCH] Disable all inputs on login submission, re-enable them on error Signed-off-by: DL6ER --- scripts/pi-hole/js/login.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/pi-hole/js/login.js b/scripts/pi-hole/js/login.js index 763ecc56..a1e4b5ca 100644 --- a/scripts/pi-hole/js/login.js +++ b/scripts/pi-hole/js/login.js @@ -5,6 +5,8 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ +/* global utils:false */ + function getParams() { var GETDict = {}; window.location.search @@ -102,6 +104,7 @@ function wrongPassword(isError = false, isSuccess = false, data = null) { function doLogin(password) { wrongPassword(false, false, null); + utils.disableAll(); $.ajax({ url: "/api/auth", method: "POST", @@ -115,6 +118,7 @@ function doLogin(password) { }) .fail(function (data) { wrongPassword(true, false, data); + utils.enableAll(); }); }