fix(passkey): ensure addPasskey returns passkey data instead of undefined (#5736)

This commit is contained in:
Maxwell Weru
2025-11-20 00:01:30 -08:00
committed by Alex Yang
parent a5ca2769ae
commit ef15bfb2c5
+2 -3
View File
@@ -128,9 +128,7 @@ export const getPasskeyActions = (
optionsJSON: options.data,
useAutoRegister: opts?.useAutoRegister,
});
const verified = await $fetch<{
passkey: Passkey;
}>("/passkey/verify-registration", {
const verified = await $fetch<Passkey>("/passkey/verify-registration", {
...opts?.fetchOptions,
...fetchOpts,
body: {
@@ -145,6 +143,7 @@ export const getPasskeyActions = (
return verified;
}
$listPasskeys.set(Math.random());
return verified;
} catch (e) {
if (e instanceof WebAuthnError) {
if (e.code === "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED") {