Skip to content

Commit 27ee9c1

Browse files
fix: Use correct registrationInfo.credential structure from simplewebauthn v13
1 parent 871ff26 commit 27ee9c1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/idp/passkey.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ export async function registrationVerify(request, reply) {
171171
return reply.code(400).send({ error: 'Verification failed' });
172172
}
173173

174-
const { credential: regCredential, credentialPublicKey, counter } = verification.registrationInfo;
174+
const { credential: regCredential } = verification.registrationInfo;
175175

176176
await accounts.addPasskey(accountId, {
177-
credentialId: Buffer.from(regCredential.id).toString('base64url'),
178-
publicKey: Buffer.from(credentialPublicKey).toString('base64url'),
179-
counter,
180-
transports: credential.response?.transports || [],
177+
credentialId: regCredential.id, // Already base64url string
178+
publicKey: Buffer.from(regCredential.publicKey).toString('base64url'),
179+
counter: regCredential.counter,
180+
transports: regCredential.transports || credential.response?.transports || [],
181181
name: name || 'Security Key'
182182
});
183183

0 commit comments

Comments
 (0)