From f2cdfb871ff4df308a7ffbadbc8f5c16b74ad8f2 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 8 Apr 2024 15:48:53 +0200 Subject: [PATCH] Do not allow user to submit login without a username and a password --- application/views/pages/login.php | 8 ++++++-- assets/js/pages/login.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/views/pages/login.php b/application/views/pages/login.php index d54cff4a..f68e5763 100644 --- a/application/views/pages/login.php +++ b/application/views/pages/login.php @@ -18,14 +18,18 @@ - +
- +
diff --git a/assets/js/pages/login.js b/assets/js/pages/login.js index 06282cb5..3ad7bd35 100644 --- a/assets/js/pages/login.js +++ b/assets/js/pages/login.js @@ -32,6 +32,10 @@ App.Pages.Login = (function () { const username = $username.val(); const password = $password.val(); + if (!username || !password) { + return; + } + const $alert = $('.alert'); $alert.addClass('d-none');