// ===================== // FINGERPRINT AUTH FOR ADMINS // ===================== // 1. Add fingerprint button to login page add_action('login_form', 'add_fingerprint_login_button'); function add_fingerprint_login_button() { echo '

Use Password Instead

'; } // 2. Load required JavaScript add_action('login_enqueue_scripts', 'load_fingerprint_scripts'); function load_fingerprint_scripts() { wp_enqueue_script('webauthn-js', 'https://cdn.jsdelivr.net/npm/webauthn-json@2.0/dist/browser/webauthn-json.js'); wp_add_inline_script('webauthn-js', ' document.getElementById("fingerprint-login-btn").addEventListener("click", async () => { try { // Step 1: Get challenge from server (simplified) const challenge = new Uint8Array(32); window.crypto.getRandomValues(challenge); // Step 2: Ask browser for fingerprint const credential = await WebAuthnJSON.get({ publicKey: { challenge: challenge, timeout: 60000, userVerification: "required" } }); // Step 3: Verify fingerprint (simplified - real check needs server-side) alert("Fingerprint verified! Redirecting to admin..."); window.location.href = "' . admin_url() . '"; } catch (error) { alert("Fingerprint failed: " + error); } }); '); } Shop - Promage

Shop