debug: add step-by-step alerts to trace passkey registration flow
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 2m24s

This commit is contained in:
Gan, Jimmy
2026-03-11 01:30:12 +08:00
parent 7277560856
commit 5c5baba3d4
@@ -36,13 +36,18 @@
}
async function registerPasskey() {
alert("registerPasskey called!");
passkeyLoading = true;
passkeyMsg = ""; passkeyErr = "";
try {
alert("Checking PublicKeyCredential support...");
if (!window.PublicKeyCredential) {
alert("PublicKeyCredential NOT supported!");
throw new Error("Passkeys are not supported in this browser or context");
}
alert("Fetching registration options...");
const opts = await post("/auth/passkey/register/options");
alert("Got options: " + JSON.stringify(opts).substring(0, 100));
opts.challenge = base64urlToBuffer(opts.challenge);
opts.user.id = base64urlToBuffer(opts.user.id);
if (opts.excludeCredentials) {