Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Fix js error on a custom view without require ids
Browse files Browse the repository at this point in the history
  • Loading branch information
lahaxearnaud committed Jul 20, 2019
1 parent 219cf0a commit 5121e7b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ var u2fClient = {
var alert = null;

if (data.errorCode) {
alert = document.getElementById('u2f-error');
alert.innerHTML = errors[data.errorCode];
alert.classList.toggle('d-none');
alert.classList.toggle('d-block');
if (alert) {
alert = document.getElementById('u2f-error');
alert.innerHTML = errors[data.errorCode];
alert.classList.toggle('d-none');
alert.classList.toggle('d-block');
}

return;
}
Expand All @@ -22,8 +24,10 @@ var u2fClient = {
var auth = document.getElementById('authentication');

alert = document.getElementById('u2f-success');
alert.classList.toggle('d-none');
alert.classList.toggle('d-block');
if (alert) {
alert.classList.toggle('d-none');
alert.classList.toggle('d-block');
}
auth.value = JSON.stringify(data);
form.submit();
});
Expand Down

0 comments on commit 5121e7b

Please sign in to comment.