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

Closed
opened 2026-03-13 12:50:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5736
Author: @mburumaxwell
Created: 11/3/2025
Status: Merged
Merged: 11/20/2025
Merged by: @himself65

Base: canaryHead: fix/addpasskey-undefined-return


📝 Commits (1)

  • 8ccfc36 fix(passkey): ensure addPasskey returns passkey data instead of undefined

📊 Changes

1 file changed (+2 additions, -3 deletions)

View changed files

📝 packages/passkey/src/client.ts (+2 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5736 **Author:** [@mburumaxwell](https://github.com/mburumaxwell) **Created:** 11/3/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/addpasskey-undefined-return` --- ### 📝 Commits (1) - [`8ccfc36`](https://github.com/better-auth/better-auth/commit/8ccfc36cca05ee3e61183ed0cb64863c65b6f91b) fix(passkey): ensure addPasskey returns passkey data instead of undefined ### 📊 Changes **1 file changed** (+2 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/passkey/src/client.ts` (+2 -3) </details> ### 📄 Description ## 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. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:50:30 -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#6189