Update Passkey Registration to comply with @simplewebauthn/browser v13+ API
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 49s

Refactor the Passkey registration logic in multiple components to utilize the new API structure requiring { optionsJSON: options }. Enhance debug logging to validate options, including checks for user ID format and challenge type. This update aims to improve compliance with the latest library requirements and provide better insights during the registration process.
This commit is contained in:
Torsten Schulz (local)
2026-01-08 17:10:13 +01:00
parent 73ae8599c3
commit badf91afef
4 changed files with 63 additions and 11 deletions

View File

@@ -319,7 +319,8 @@ const addPasskey = async () => {
const name = window.prompt('Name für den Passkey (z.B. "iPhone", "Laptop"):', 'Passkey') || 'Passkey'
const res = await $fetch('/api/auth/passkeys/registration-options', { method: 'POST' })
const mod = await import('@simplewebauthn/browser')
const credential = await mod.startRegistration(res.options)
// @simplewebauthn/browser v13+ erwartet { optionsJSON: options }
const credential = await mod.startRegistration({ optionsJSON: res.options })
await $fetch('/api/auth/passkeys/register', {
method: 'POST',
body: { credential, name }