mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
fix: update webAuthnBufferDecode to support Base64URL for WebAuthn updates (#1734)
This commit is contained in:
@ -71,8 +71,12 @@ export function deleteUserWebAuthnCredential(credentialID) {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
// Base64 to ArrayBuffer
|
||||
// Base64URL to ArrayBuffer
|
||||
export function webAuthnBufferDecode(value) {
|
||||
value = value.replace(/-/g, "+").replace(/_/g, "/");
|
||||
while (value.length % 4) {
|
||||
value += "=";
|
||||
}
|
||||
return Uint8Array.from(atob(value), c => c.charCodeAt(0));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user