Update Passkey Registration to comply with @simplewebauthn/browser v13+ API
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 49s
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:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user