Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/javascript/packs/webauthn-authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function webauthn() {
}
return window.btoa(binary);
};
// If webauthn is not supported redirect back to the 2fa options list
if (!(navigator && navigator.credentials && navigator.credentials.create)) {
Comment thread
stevegsa marked this conversation as resolved.
window.location.href = '/login/two_factor/options';
}
const challengeBytes = new Uint8Array(JSON.parse(document.getElementById('user_challenge').value));
let credentialIds = document.getElementById('credential_ids').value;
credentialIds = credentialIds.split(',');
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/packs/webauthn-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function webauthn() {
};
if (location.href.indexOf('?error=') === -1 &&
!(navigator && navigator.credentials && navigator.credentials.create)) {
window.location.href = '/login/two_factor/options';
window.location.href = '/webauthn_setup?error=NotSupportedError';
}
const continueButton = document.getElementById('continue-button');
continueButton.addEventListener('click', () => {
Expand Down