浏览代码

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

andryyy 4 年之前
父节点
当前提交
21a75c1fd1
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      data/web/inc/footer.inc.php

+ 5 - 1
data/web/inc/footer.inc.php

@@ -167,7 +167,11 @@ $(document).ready(function() {
         throw new Error();
       }
     }).catch(function(err) {
-      mailcow_alert_box(lang_fido2.fido2_validation_failed, "danger");
+      if (typeof err.message === 'undefined') {
+        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