Do not allow user to submit login without a username and a password

This commit is contained in:
Alex Tselegidis 2024-04-08 15:48:53 +02:00
parent bbf8869d3b
commit 4570d0859e
2 changed files with 10 additions and 2 deletions

View file

@ -18,14 +18,18 @@
<label for="username" class="form-label"> <label for="username" class="form-label">
<?= lang('username') ?> <?= lang('username') ?>
</label> </label>
<input type="text" id="username" placeholder="<?= lang('enter_username_here') ?>" class="form-control"/> <input type="text" id="username" placeholder="<?= lang(
'enter_username_here',
) ?>" class="form-control" required/>
</div> </div>
<div class="mb-5"> <div class="mb-5">
<label for="password" class="form-label"> <label for="password" class="form-label">
<?= lang('password') ?> <?= lang('password') ?>
</label> </label>
<input type="password" id="password" placeholder="<?= lang('enter_password_here') ?>" class="form-control"/> <input type="password" id="password" placeholder="<?= lang(
'enter_password_here',
) ?>" class="form-control" required/>
</div> </div>
<div class="d-flex justify-content-between align-items-center mb-5"> <div class="d-flex justify-content-between align-items-center mb-5">

View file

@ -32,6 +32,10 @@ App.Pages.Login = (function () {
const username = $username.val(); const username = $username.val();
const password = $password.val(); const password = $password.val();
if (!username || !password) {
return;
}
const $alert = $('.alert'); const $alert = $('.alert');
$alert.addClass('d-none'); $alert.addClass('d-none');