Add CORS testing documentation and HTML test page for Passkey Cross-Device Authentication
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 55s

Introduce a comprehensive CORS testing guide in CORS_TEST_ANLEITUNG.md, detailing steps for testing OPTIONS and POST requests, along with expected responses. Additionally, add a new HTML test page (test-cors.html) to facilitate interactive testing of CORS headers and responses for the Passkey registration API. Update the server API to ensure proper CORS headers are set for Cross-Device Authentication, enhancing the overall testing and debugging process.
This commit is contained in:
Torsten Schulz (local)
2026-01-08 11:14:22 +01:00
parent 010e89212f
commit 34968742f0
6 changed files with 592 additions and 30 deletions

View File

@@ -505,8 +505,7 @@ const handleRegisterWithPasskey = async () => {
const webauthnStart = Date.now()
const mod = await import('@simplewebauthn/browser')
// startRegistration erwartet die Options direkt
// @simplewebauthn/browser v13+ erwartet die Options direkt
// startRegistration erwartet die Options direkt (wie in anderen Dateien auch)
let credential
try {
// Timeout-Warnung nach 2 Minuten
@@ -517,29 +516,11 @@ const handleRegisterWithPasskey = async () => {
console.warn('[DEBUG] Challenge:', pre.options?.challenge)
}, 120000)
// Stelle sicher, dass die Options korrekt formatiert sind
// @simplewebauthn/browser v13+ erwartet die Options direkt als Objekt
const registrationOptions = {
challenge: pre.options.challenge,
rp: pre.options.rp,
user: pre.options.user,
pubKeyCredParams: pre.options.pubKeyCredParams,
timeout: pre.options.timeout,
attestation: pre.options.attestation || 'none',
excludeCredentials: pre.options.excludeCredentials || [],
authenticatorSelection: pre.options.authenticatorSelection,
extensions: pre.options.extensions || {}
}
console.log('[DEBUG] startRegistration called - QR-Code should appear now (if Cross-Device)')
console.log('[DEBUG] Registration options structure:', {
hasChallenge: !!registrationOptions.challenge,
hasRp: !!registrationOptions.rp,
hasUser: !!registrationOptions.user,
timeout: registrationOptions.timeout
})
console.log('[DEBUG] Passing options directly to startRegistration (same as in profil.vue)')
credential = await mod.startRegistration(registrationOptions)
// Direkt die Options übergeben (wie in profil.vue und passkey-wiederherstellen.vue)
credential = await mod.startRegistration(pre.options)
clearTimeout(timeoutWarning)