Procházet zdrojové kódy

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 před 1 rokem
rodič
revize
71c7845c42
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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) {