Explorar o código

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.
jvoisin hai 1 ano
pai
achega
71c7845c42
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      internal/ui/static/js/webauthn_handler.js

+ 1 - 1
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) {