Enhance debug logging for Passkey Registration options
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 44s
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:
@@ -444,6 +444,28 @@ const handleRegisterWithPasskey = async () => {
|
||||
throw new Error('Ungültige WebAuthn-Options vom Server')
|
||||
}
|
||||
|
||||
// Debug: Prüfe die vollständige Options-Struktur
|
||||
console.log('[DEBUG] Full options structure check:', {
|
||||
hasChallenge: !!pre.options.challenge,
|
||||
challengeValue: pre.options.challenge?.substring(0, 20) + '...',
|
||||
challengeType: typeof pre.options.challenge,
|
||||
hasRp: !!pre.options.rp,
|
||||
rpId: pre.options.rp?.id,
|
||||
rpName: pre.options.rp?.name,
|
||||
hasUser: !!pre.options.user,
|
||||
userId: pre.options.user?.id ? 'present' : 'missing',
|
||||
userIdType: typeof pre.options.user?.id,
|
||||
userName: pre.options.user?.name,
|
||||
userDisplayName: pre.options.user?.displayName,
|
||||
hasPubKeyCredParams: !!pre.options.pubKeyCredParams,
|
||||
pubKeyCredParamsCount: pre.options.pubKeyCredParams?.length,
|
||||
hasAuthenticatorSelection: !!pre.options.authenticatorSelection,
|
||||
timeout: pre.options.timeout,
|
||||
timeoutType: typeof pre.options.timeout,
|
||||
allKeys: Object.keys(pre.options),
|
||||
optionsStringified: JSON.stringify(pre.options).substring(0, 200) + '...'
|
||||
})
|
||||
|
||||
console.log('[DEBUG] Calling startRegistration...')
|
||||
console.log('[DEBUG] Full options object (will be encoded in QR code for Cross-Device):', JSON.stringify(pre.options, null, 2))
|
||||
console.log('[DEBUG] Options summary for startRegistration:', {
|
||||
|
||||
@@ -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 }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user