Enhance debug logging for Cross-Device Passkey Registration
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 50s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 50s
Add detailed debug statements in the registrieren.vue component to provide insights into the QR-Code generation process and the Cross-Device authentication flow. Additionally, update the register-passkey API to log request details, including user agent and method, to improve troubleshooting capabilities and ensure clarity during the registration process.
This commit is contained in:
@@ -518,6 +518,24 @@ const handleRegisterWithPasskey = async () => {
|
||||
|
||||
console.log('[DEBUG] startRegistration called - QR-Code should appear now (if Cross-Device)')
|
||||
console.log('[DEBUG] Passing options directly to startRegistration (same as in profil.vue)')
|
||||
console.log('[DEBUG] Options for QR-Code:', {
|
||||
rpId: pre.options.rp?.id,
|
||||
rpName: pre.options.rp?.name,
|
||||
challenge: pre.options.challenge?.substring(0, 20) + '...',
|
||||
timeout: pre.options.timeout,
|
||||
timeoutSeconds: Math.round(pre.options.timeout / 1000),
|
||||
note: 'Der Browser generiert automatisch einen QR-Code. Das Smartphone muss diese Origin erreichen können: ' + window.location.origin
|
||||
})
|
||||
|
||||
// WICHTIG: Für Cross-Device muss das Smartphone die gleiche Origin erreichen können
|
||||
// Der QR-Code enthält die Challenge und die Server-Info
|
||||
// Das Smartphone öffnet dann die Website und sendet die Credential-Response zurück
|
||||
console.log('[DEBUG] Cross-Device Flow:')
|
||||
console.log('[DEBUG] 1. Browser generiert QR-Code mit Challenge:', pre.options.challenge?.substring(0, 20) + '...')
|
||||
console.log('[DEBUG] 2. Smartphone scannt QR-Code')
|
||||
console.log('[DEBUG] 3. Smartphone muss diese URL erreichen können:', window.location.origin)
|
||||
console.log('[DEBUG] 4. Smartphone sendet Credential-Response an:', window.location.origin + '/api/auth/register-passkey')
|
||||
console.log('[DEBUG] 5. Server verifiziert die Response')
|
||||
|
||||
// Direkt die Options übergeben (wie in profil.vue und passkey-wiederherstellen.vue)
|
||||
credential = await mod.startRegistration(pre.options)
|
||||
|
||||
Reference in New Issue
Block a user