Erweitere die Passkey-Registrierung um Unterstützung für bevorzugte Authentifikatortypen und verbessere die Fehlerbehandlung.
All checks were successful
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m58s

This commit is contained in:
Torsten Schulz (local)
2026-05-15 13:30:15 +02:00
parent 8ae7dcdbf1
commit 48f8b46e57
2 changed files with 58 additions and 4 deletions

View File

@@ -18,6 +18,11 @@ export default defineEventHandler(async (event) => {
return { success: true }
}
const body = await readBody(event)
const preferredAuthenticatorType = ['securityKey', 'localDevice', 'remoteDevice'].includes(body?.preferredAuthenticatorType)
? body.preferredAuthenticatorType
: undefined
const token = getCookie(event, 'auth_token')
const user = token ? await getUserFromToken(token) : null
@@ -64,6 +69,7 @@ export default defineEventHandler(async (event) => {
// authenticatorAttachment weglassen = beide Typen erlauben (platform + cross-platform)
},
excludeCredentials,
preferredAuthenticatorType,
// Timeout erhöhen für Cross-Device (Standard: 60s, hier: 5 Minuten)
timeout: 300000
})