CZ-NIC / django-fido

Django application for FIDO protocol U2F
GNU General Public License v3.0
28 stars 11 forks source link

Fix broken JavaScript in case of missing submit button #34

Closed stinovlas closed 4 years ago

stinovlas commented 4 years ago

From django_fido/js/fido2.js:

const submit_button = document.getElementById('submit-button')
// If is empty values, submit button reload page
submit_button.addEventListener('click', e => { … })

When there is no element with id submit-button present on the page, this code fails. I believe that this is valid case and therefore, there should probably be a condition. Even after #33, the code still shouldn't produce errors in JavaScript console.

stinovlas commented 4 years ago

Issue was resolved in #35.