]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/Utils.js
ui: u2f: refactor error code map out and use in login window
[pve-manager.git] / www / manager6 / Utils.js
index ffa6970a8002d61cf1ee459ea8262d80b2be5e7e..2d056d3cd3d13779bf909d60869f0bbf979c37a0 100644 (file)
@@ -808,6 +808,17 @@ Ext.define('PVE.Utils', { utilities: {
        return Ext.htmlEncode(first + " " + last);
     },
 
+    render_u2f_error: function(error) {
+       var ErrorNames = {
+           '1': gettext('Other Error'),
+           '2': gettext('Bad Request'),
+           '3': gettext('Configuration Unsupported'),
+           '4': gettext('Device Ineligible'),
+           '5': gettext('Timeout')
+       };
+       return "U2F Error: "  + ErrorNames[error] || Proxmox.Utils.unknownText;
+    },
+
     windowHostname: function() {
        return window.location.hostname.replace(Proxmox.Utils.IP6_bracket_match,
             function(m, addr, offset, original) { return addr; });