UNPKG

@adonis-agora/authkit-react

Version:

Frontend ergonomics over AuthKit for AdonisJS + Inertia + React apps: a typed useAuth() hook, role-gating hooks and gating components.

9 lines (8 loc) • 437 B
import { loadStartRegistration } from './authenticate.js'; export async function registerPasskeyJson(client, deps = {}) { const loadFn = deps.loadStartRegistration ?? loadStartRegistration; const optionsJSON = await client.account.mfa.passkeys.options(); const startRegistration = await loadFn(); const attestation = await startRegistration({ optionsJSON }); return client.account.mfa.passkeys.verify(attestation); }