PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.2.4
Defender Security – Malware Scanner, Login Security & Firewall v6.2.4
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / assets / js / biometric-login.js

biometric-login.js in Defender Security – Malware Scanner, Login Security & Firewall 6.2.4, at assets/js/biometric-login.js

2 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 function _createForOfIteratorHelper(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var t=0,a=function(){};return{s:a,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){f=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(f)throw i}}}}function _unsupportedIterableToArray(e,n){if(e){if("string"==typeof e)return _arrayLikeToArray(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,n):void 0}}function _arrayLikeToArray(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}!function(e){var n=!1,r=null,t=e("#login"),a=t.find("#wpdef-2fa-form-"+webauthn.provider_slug);function i(r,t){r.preventDefault(),!0!==n&&!1!==wpdefCheckBrowserSupportForWebauthn()&&(o(),e.ajax({url:webauthn.admin_url,type:"POST",data:{action:"defender_webauthn_get_option",username:webauthn.username,type:t,_def_nonce:webauthn.nonce},success:function(e){if(!1===e.success||void 0===e.data.challenge){return d("undefined"!==e.data.message&&"undefined"!==e.data.code&&0<e.data.code?e.data.message:webauthn.i18n.login_failed),void f()}var n=e.data;if(n.challenge=Uint8Array.from(window.atob(wpdefBase64Url2Base64(n.challenge)),function(e){return e.charCodeAt(0)}),n.allowCredentials){var r,i=_createForOfIteratorHelper(n.allowCredentials);try{for(i.s();!(r=i.n()).done;){var o=r.value;"cross-platform"===t?o.transports=["usb","nfc","ble"]:"platform"===t&&(o.transports=["internal"]),o.id=Uint8Array.from(window.atob(wpdefBase64Url2Base64(o.id)),function(e){return e.charCodeAt(0)})}}catch(e){i.e(e)}finally{i.f()}}var c=n.clientID;delete n.clientID,navigator.credentials.get({publicKey:n}).then(function(e){return{id:e.id,type:e.type,rawId:wpdefArrayToBase64String(new Uint8Array(e.rawId)),response:{authenticatorData:wpdefArrayToBase64String(new Uint8Array(e.response.authenticatorData)),clientDataJSON:wpdefArrayToBase64String(new Uint8Array(e.response.clientDataJSON)),signature:wpdefArrayToBase64String(new Uint8Array(e.response.signature)),userHandle:e.response.userHandle?wpdefArrayToBase64String(new Uint8Array(e.response.userHandle)):null}}}).then(JSON.stringify).then(function(e){a.find("#wpdef-2fa-biometric-data").val(window.btoa(e)),a.find("#wpdef-2fa-biometric-username").val(webauthn.username),a.find("#wpdef-2fa-biometric-client-id").val(c),a.find("#wpdef-2fa-biometric-nonce").val(webauthn.nonce),a.find("#wpdef-2fa-biometric-submit-btn").trigger("click")}).catch(function(){d(webauthn.i18n.login_failed),f()})},error:function(){d(webauthn.i18n.login_failed),f()}}))}function o(){n=!0,t.find("#login_error").remove(),a.find(".welcome-screen").hide(),a.find(".webauthn-"+r).show(),a.find(".wpdef-2fa-webauthn-control").hide(),a.find(".wpdef-2fa-biometric-process-desc").show()}function f(){n=!1,a.find(".wpdef-2fa-biometric-process-desc").hide(),a.find(".wpdef-2fa-webauthn-control").show()}function d(e){var n='<div id="login_error" class="notice notice-error">'+e+"</div>";t.find("h1").after(n)}e(function(){!1===wpdefCheckBrowserSupportForWebauthn()&&(e=webauthn.i18n.client_webauthn_notice,n='<div class="wpdef-notice warning webauthn-client-notice"><span class="dashicons dashicons-info"></span><span class="wpdef-notice-message">'+e+"</span></div>",a.append(n),a.find(".wpdef-2fa-biometric-process-desc").hide());var e,n}),a.find(".option-row").on("click",function(n){i(n,r=e(this).attr("data-authType"))}),a.find("#wpdef-2fa-biometric-retry-btn").on("click",function(e){null!==r&&i(e,r)}),a.find("#wpdef-2fa-webauthn-back-btn").on("click",function(){null!==r&&(t.find("#login_error").remove(),a.find(".welcome-screen").show(),a.find(".webauthn-"+r).hide(),a.find(".wpdef-2fa-webauthn-control").hide())})}(jQuery);
2