Enhance deployment script and registration components with improved error handling and debug logging
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 55s

Update deploy-production.sh to include comprehensive build validation checks, ensuring critical files and directories are present before proceeding. Enhance the registrieren.vue component to conditionally display the window origin and improve debug logging for the registration process. Additionally, add debug information in the register-passkey-options API to capture request details, including environment and process ID, for better troubleshooting capabilities.
This commit is contained in:
Torsten Schulz (local)
2026-01-08 08:59:57 +01:00
parent f05d47be4c
commit 8fa8c8b5d9
3 changed files with 117 additions and 14 deletions

View File

@@ -183,7 +183,7 @@
<div class="space-y-1 text-blue-800">
<div><strong>Challenge:</strong> <code class="bg-blue-100 px-1 rounded">{{ debugChallenge.substring(0, 40) }}...</code></div>
<div><strong>RP-ID:</strong> <code class="bg-blue-100 px-1 rounded">{{ debugRpId }}</code></div>
<div><strong>Origin:</strong> <code class="bg-blue-100 px-1 rounded">{{ window.location.origin }}</code></div>
<div><strong>Origin:</strong> <code class="bg-blue-100 px-1 rounded">{{ typeof window !== 'undefined' ? window.location.origin : 'N/A (SSR)' }}</code></div>
<div class="mt-2 text-blue-700">
<strong>Hinweis:</strong> Der QR-Code wird vom Browser generiert.
Prüfe in der Browser-Konsole (F12) für vollständige Debug-Ausgaben.
@@ -513,12 +513,33 @@ const handleRegisterWithPasskey = async () => {
const timeoutWarning = setTimeout(() => {
console.warn('[DEBUG] startRegistration still waiting after 2 minutes. This might be a Cross-Device timeout.')
console.warn('[DEBUG] Make sure your smartphone can reach the server and CORS is configured correctly.')
console.warn('[DEBUG] Current origin:', window.location.origin)
console.warn('[DEBUG] Current origin:', typeof window !== 'undefined' ? window.location.origin : 'N/A')
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)')
credential = await mod.startRegistration(pre.options)
console.log('[DEBUG] Registration options structure:', {
hasChallenge: !!registrationOptions.challenge,
hasRp: !!registrationOptions.rp,
hasUser: !!registrationOptions.user,
timeout: registrationOptions.timeout
})
credential = await mod.startRegistration(registrationOptions)
clearTimeout(timeoutWarning)