Disable all inputs on login submission, re-enable them on error

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-11-13 09:31:42 +01:00
parent 4c50b49ed3
commit c5b51e8969

View File

@@ -5,6 +5,8 @@
* This file is copyright under the latest version of the EUPL. * This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */ * Please see LICENSE file for your rights under this license. */
/* global utils:false */
function getParams() { function getParams() {
var GETDict = {}; var GETDict = {};
window.location.search window.location.search
@@ -102,6 +104,7 @@ function wrongPassword(isError = false, isSuccess = false, data = null) {
function doLogin(password) { function doLogin(password) {
wrongPassword(false, false, null); wrongPassword(false, false, null);
utils.disableAll();
$.ajax({ $.ajax({
url: "/api/auth", url: "/api/auth",
method: "POST", method: "POST",
@@ -115,6 +118,7 @@ function doLogin(password) {
}) })
.fail(function (data) { .fail(function (data) {
wrongPassword(true, false, data); wrongPassword(true, false, data);
utils.enableAll();
}); });
} }