Skip to content

Commit

Permalink
Prevent login before extra.js is loaded (#3275)
Browse files Browse the repository at this point in the history
Disable submit button until extra.js with its crypto functions is
loaded.
  • Loading branch information
Alkarex committed Dec 22, 2020
1 parent 98b8284 commit 48e0464
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/auth/formLogin.phtml
Expand Up @@ -31,7 +31,7 @@
</div>

<div class="form-group form-group-actions">
<button id="loginButton" type="submit" class="btn btn-important">
<button id="loginButton" type="submit" class="btn btn-important" disabled="disabled">
<?= _t('gen.auth.login') ?>
</button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion p/scripts/extra.js
Expand Up @@ -51,8 +51,10 @@ function init_crypto_form() {

forgetOpenCategories();

const submit_button = document.querySelector('button[type="submit"]');
submit_button.disabled = false;

crypto_form.onsubmit = function (e) {
const submit_button = this.querySelector('button[type="submit"]');
submit_button.disabled = true;
let success = false;

Expand Down

0 comments on commit 48e0464

Please sign in to comment.