From 08f9671aaf09d7dd10a4cfa308f365c6bb8ca351 Mon Sep 17 00:00:00 2001 From: Roberto Hidalgo Date: Wed, 4 Jan 2023 14:04:37 -0600 Subject: [PATCH] encode as mdn tells me to --- internal/server/static/webauthn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/static/webauthn.js b/internal/server/static/webauthn.js index 0b42bbd..82b4c3e 100644 --- a/internal/server/static/webauthn.js +++ b/internal/server/static/webauthn.js @@ -3,7 +3,7 @@ import * as webauthnJSON from 'https://unpkg.com/@github/webauthn-json@2.0.2/dist/esm/webauthn-json.browser-ponyfill.js' const charsToEncode = /[\u007f-\uffff]/g; function JSONtob64(data) { - return btoa(JSON.stringify(data).replace(charsToEncode, (c) => '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4))) + return btoa(encodeURIComponent(JSON.stringify(data).replace(charsToEncode, (c) => '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4)))) } function b64ToJSON(encoded) {