[Web] FIDO2: Print thrown error in verification failure, if any

master
andryyy 2020-11-16 08:55:45 +01:00
parent 9dec340434
commit 21a75c1fd1
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,11 @@ $(document).ready(function() {
throw new Error(); throw new Error();
} }
}).catch(function(err) { }).catch(function(err) {
if (typeof err.message === 'undefined') {
mailcow_alert_box(lang_fido2.fido2_validation_failed, "danger"); mailcow_alert_box(lang_fido2.fido2_validation_failed, "danger");
} else {
mailcow_alert_box(lang_fido2.fido2_validation_failed + ":<br><i>" + err.message + "</i>", "danger");
}
}); });
}); });
// Set TFA/FIDO2 // Set TFA/FIDO2