Füge Hinweise zur Verwendung externer Authenticatoren in Firefox hinzu und passe die Registrierung von Passkeys an.
All checks were successful
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m58s

This commit is contained in:
Torsten Schulz (local)
2026-05-15 14:13:22 +02:00
parent 28b1001826
commit 5f96f719c1

View File

@@ -205,6 +205,9 @@
<p class="text-sm text-gray-600 mb-4">
Passkeys erlauben eine Anmeldung ohne Passwort. Je nach Gerät erfolgt die Einrichtung lokal oder über Smartphone/USB-Sicherheitsschlüssel.
</p>
<p class="text-xs text-gray-500 mb-4">
Hinweis: Unter Firefox wird für maximale Kompatibilität ein externer Authenticator (Smartphone oder USB-Sicherheitsschlüssel) bevorzugt.
</p>
<p
v-if="!isPasskeySupported"
@@ -416,11 +419,15 @@ const addPasskey = async () => {
const name = window.prompt('Name für den Passkey (z.B. "iPhone", "Laptop"):', 'Passkey') || 'Passkey'
const mod = await import('@simplewebauthn/browser')
// localDevice nur setzen, wenn das Gerät wirklich einen Platform-Authenticator hat.
// Firefox auf Linux: externen Authenticator (USB/Smartphone) bevorzugen.
// Chromium: localDevice nur setzen, wenn das Gerät wirklich einen Platform-Authenticator hat.
const firefox = isFirefoxBrowser()
const platformAvailable = await hasPlatformAuthenticator()
const registrationOptionsRequest = (!firefox && platformAvailable)
? { method: 'POST', body: { preferredAuthenticatorType: 'localDevice' } }
const preferredAuthenticatorType = firefox
? 'securityKey'
: (platformAvailable ? 'localDevice' : undefined)
const registrationOptionsRequest = preferredAuthenticatorType
? { method: 'POST', body: { preferredAuthenticatorType } }
: { method: 'POST' }
const res = await $fetch('/api/auth/passkeys/registration-options', registrationOptionsRequest)