mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 18:58:28 +00:00
Disable all inputs on login submission, re-enable them on error
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user