Füge Hinweise zur Verwendung externer Authenticatoren in Firefox hinzu und passe die Registrierung von Passkeys an.
This commit is contained in:
@@ -205,6 +205,9 @@
|
|||||||
<p class="text-sm text-gray-600 mb-4">
|
<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.
|
Passkeys erlauben eine Anmeldung ohne Passwort. Je nach Gerät erfolgt die Einrichtung lokal oder über Smartphone/USB-Sicherheitsschlüssel.
|
||||||
</p>
|
</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
|
<p
|
||||||
v-if="!isPasskeySupported"
|
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 name = window.prompt('Name für den Passkey (z.B. "iPhone", "Laptop"):', 'Passkey') || 'Passkey'
|
||||||
const mod = await import('@simplewebauthn/browser')
|
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 firefox = isFirefoxBrowser()
|
||||||
const platformAvailable = await hasPlatformAuthenticator()
|
const platformAvailable = await hasPlatformAuthenticator()
|
||||||
const registrationOptionsRequest = (!firefox && platformAvailable)
|
const preferredAuthenticatorType = firefox
|
||||||
? { method: 'POST', body: { preferredAuthenticatorType: 'localDevice' } }
|
? 'securityKey'
|
||||||
|
: (platformAvailable ? 'localDevice' : undefined)
|
||||||
|
const registrationOptionsRequest = preferredAuthenticatorType
|
||||||
|
? { method: 'POST', body: { preferredAuthenticatorType } }
|
||||||
: { method: 'POST' }
|
: { method: 'POST' }
|
||||||
|
|
||||||
const res = await $fetch('/api/auth/passkeys/registration-options', registrationOptionsRequest)
|
const res = await $fetch('/api/auth/passkeys/registration-options', registrationOptionsRequest)
|
||||||
|
|||||||
Reference in New Issue
Block a user