fix: pass Base64URL salt during registration

This commit is contained in:
2026-05-29 10:29:58 +02:00
parent 1c56136645
commit fe8c5f12c6
+6 -2
View File
@@ -90,11 +90,15 @@ export async function registerUser(username: string): Promise<RegistrationResult
const options = await optionsRes.json() const options = await optionsRes.json()
// Request the PRF extension in the browser options (empty object is standard for enabling PRF) // Request the PRF extension in the browser options
if (!options.extensions) { if (!options.extensions) {
options.extensions = {} options.extensions = {}
} }
options.extensions.prf = {} options.extensions.prf = {
eval: {
first: bufferToBase64URL(PRF_SALT.buffer)
}
}
// 2. Start biometric Passkey creation // 2. Start biometric Passkey creation
const credentialResponse = await startRegistration({ optionsJSON: options }) const credentialResponse = await startRegistration({ optionsJSON: options })