From 71c7845c4261e9ba3d323cc65dfdd367469f7bbe Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 20 Jan 2025 15:44:53 +0100 Subject: [PATCH] Anchor `=` removal in webauthn_handler.js Since we're base64-encoding, `=` can only happen at the end, so no need to traverse the whole payload. --- internal/ui/static/js/webauthn_handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ui/static/js/webauthn_handler.js b/internal/ui/static/js/webauthn_handler.js index 2714f4c4..c12c9646 100644 --- a/internal/ui/static/js/webauthn_handler.js +++ b/internal/ui/static/js/webauthn_handler.js @@ -42,7 +42,7 @@ class WebAuthnHandler { return btoa(String.fromCharCode.apply(null, new Uint8Array(value))) .replace(/\+/g, "-") .replace(/\//g, "_") - .replace(/=/g, ""); + .replace(/=+$/g, ""); } async post(urlKey, username, data) {