Add PublicKeyCredential guard for passkey registration
This commit is contained in:
@@ -40,6 +40,9 @@
|
|||||||
passkeyLoading = true;
|
passkeyLoading = true;
|
||||||
passkeyMsg = ""; passkeyErr = "";
|
passkeyMsg = ""; passkeyErr = "";
|
||||||
try {
|
try {
|
||||||
|
if (!window.PublicKeyCredential) {
|
||||||
|
throw new Error("Passkeys are not supported in this browser or context");
|
||||||
|
}
|
||||||
const opts = await post("/auth/passkey/register/options");
|
const opts = await post("/auth/passkey/register/options");
|
||||||
opts.challenge = base64urlToBuffer(opts.challenge);
|
opts.challenge = base64urlToBuffer(opts.challenge);
|
||||||
opts.user.id = base64urlToBuffer(opts.user.id);
|
opts.user.id = base64urlToBuffer(opts.user.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user