[PR #5736] fix(passkey): ensure addPasskey returns passkey data instead of undefined #14436

Closed
opened 2026-04-13 09:28:28 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5736

State: closed
Merged: Yes


Description

Fixes an issue where client.passkey.addPasskey() was returning undefined instead of the passkey data when registration succeeded.

Changes

  • Added missing return verified; statement in the registerPasskey function's success path
  • The function now correctly returns the passkey data from the server response
  • No breaking changes to the API contract

Problem

The addPasskey client method was missing a return statement after successful passkey registration. This caused the function to return undefined instead of the expected passkey data, making it impossible for consumers to access information about the newly created passkey.


Summary by cubic

Ensures client.passkey.addPasskey returns the passkey data on successful registration instead of undefined.

  • Bug Fixes
    • Added missing return after list refresh so the verified passkey is returned.
    • Updated verify-registration fetch to use Passkey as the response type.
    • No breaking changes to the API.

Written for commit 8ccfc36cca. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5736 **State:** closed **Merged:** Yes --- ## Description Fixes an issue where `client.passkey.addPasskey()` was returning `undefined` instead of the passkey data when registration succeeded. ## Changes - Added missing `return verified;` statement in the `registerPasskey` function's success path - The function now correctly returns the passkey data from the server response - No breaking changes to the API contract ## Problem The `addPasskey` client method was missing a return statement after successful passkey registration. This caused the function to return `undefined` instead of the expected passkey data, making it impossible for consumers to access information about the newly created passkey. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Ensures client.passkey.addPasskey returns the passkey data on successful registration instead of undefined. - **Bug Fixes** - Added missing return after list refresh so the verified passkey is returned. - Updated verify-registration fetch to use Passkey as the response type. - No breaking changes to the API. <sup>Written for commit 8ccfc36cca05ee3e61183ed0cb64863c65b6f91b. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:28:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14436