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 babcc774dd
commit f2cdfb871f
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');