Enhance debug logging and Cross-Device support for Passkey Registration
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 45s

Update the registrieren.vue component to include detailed debug statements for the Cross-Device authentication flow, specifically during QR-Code generation. Improve logging in the register-passkey-options and register-passkey APIs to capture request details such as user agent and IP address, aiding in troubleshooting. Additionally, introduce a new function to retrieve pre-registration data, enhancing the overall registration process and compliance with Cross-Device requirements.
This commit is contained in:
Torsten Schulz (local)
2026-01-08 23:27:11 +01:00
parent badf91afef
commit 29ef644581
7 changed files with 174 additions and 11 deletions

View File

@@ -630,6 +630,18 @@ const handleRegisterWithPasskey = async () => {
})
// Neue API-Struktur: { optionsJSON: options }
// WICHTIG: Bei Cross-Device wird der QR-Code automatisch generiert
// Das Smartphone scannt den QR-Code und öffnet die Website
// Dann ruft das Smartphone startRegistration auf, um die Credential zu erstellen
// Die Credential-Response wird dann an den Desktop-Browser zurückgesendet
console.log('[DEBUG] About to call startRegistration - this will trigger QR code generation for Cross-Device')
console.log('[DEBUG] If using Cross-Device:')
console.log('[DEBUG] 1. QR-Code wird angezeigt')
console.log('[DEBUG] 2. Smartphone scannt QR-Code')
console.log('[DEBUG] 3. Smartphone öffnet:', window.location.origin)
console.log('[DEBUG] 4. Smartphone muss startRegistration aufrufen können')
console.log('[DEBUG] 5. Smartphone sendet Credential-Response an:', window.location.origin + '/api/auth/register-passkey')
credential = await mod.startRegistration({ optionsJSON: pre.options })
clearTimeout(timeoutWarning)
@@ -640,7 +652,8 @@ const handleRegisterWithPasskey = async () => {
credentialId: credential?.id,
responseType: credential?.response?.constructor?.name,
transports: credential?.transports,
durationSeconds: Math.round(webauthnDuration / 1000)
durationSeconds: Math.round(webauthnDuration / 1000),
note: 'Wenn Cross-Device verwendet wurde, sollte die Credential-Response vom Smartphone kommen'
})
} catch (webauthnError) {
const webauthnDuration = Date.now() - webauthnStart