Enhance debug logging for Passkey Registration options
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 44s

Add detailed debug statements in the registrieren.vue component to validate the complete options structure during Passkey registration. Update the register-passkey API to simplify the options return process, eliminating unnecessary serialization while maintaining comprehensive logging of the options details for improved troubleshooting.
This commit is contained in:
Torsten Schulz (local)
2026-01-08 14:17:18 +01:00
parent a763c959ef
commit 6535abf074
2 changed files with 33 additions and 14 deletions

View File

@@ -142,24 +142,21 @@ export default defineEventHandler(async (event) => {
})
}
// Stelle sicher, dass die Options korrekt serialisiert werden
const serializedOptions = {
...options,
challenge: options.challenge,
rp: options.rp,
user: options.user,
pubKeyCredParams: options.pubKeyCredParams,
authenticatorSelection: options.authenticatorSelection,
timeout: options.timeout || 300000
}
// Options direkt zurückgeben (wie in passkeys/registration-options.post.js)
// @simplewebauthn/server gibt bereits korrekt formatierte Options zurück
const totalDuration = Date.now() - requestStart
console.log(`[DEBUG] Returning options (total: ${totalDuration}ms)`, {
registrationId,
optionsKeys: Object.keys(serializedOptions),
serializedChallengeLength: serializedOptions.challenge?.length
optionsKeys: Object.keys(options),
challengeLength: options.challenge?.length,
challengeType: typeof options.challenge,
rpId: options.rp?.id,
userIdType: typeof options.user?.id,
timeout: options.timeout
})
return { success: true, registrationId, options: serializedOptions }
// WICHTIG: Options direkt zurückgeben, keine manuelle Serialisierung
// Die Options von @simplewebauthn/server sind bereits korrekt formatiert
return { success: true, registrationId, options }
})