[PR #7328] [MERGED] fix(two-factor): use parseUserOutput for consistent user response #15479

Closed
opened 2026-04-13 10:03:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7328
Author: @krismach
Created: 1/13/2026
Status: Merged
Merged: 1/16/2026
Merged by: @himself65

Base: canaryHead: fix/two-factor-user-output


📝 Commits (4)

  • 39fd461 fix(two-factor): use parseUserOutput for consistent user response
  • 157a478 Merge branch 'canary' into fix/two-factor-user-output
  • db46894 Refactor import statements in verify-two-factor.ts
  • 9d04d28 Reorder import statements in verify-two-factor.ts

📊 Changes

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

View changed files

📝 packages/better-auth/src/plugins/two-factor/verify-two-factor.ts (+3 -18)

📄 Description

The two-factor verification endpoints (/two-factor/verify-totp, /two-factor/verify-otp) return a hardcoded user object with only basic fields, which excludes additional user fields configured through plugins like the admin plugin's role field.

This PR updates the two-factor verification response to use parseUserOutput(), ensuring consistency with other authentication endpoints


Summary by cubic

Use parseUserOutput for two-factor verification responses so user data matches other auth endpoints. This returns all configured fields (including plugin fields like role) instead of a hardcoded subset.

Written for commit 9d04d28f49. Summary will update 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/7328 **Author:** [@krismach](https://github.com/krismach) **Created:** 1/13/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/two-factor-user-output` --- ### 📝 Commits (4) - [`39fd461`](https://github.com/better-auth/better-auth/commit/39fd461cc01918d6c110a5989b61ee981ec54471) fix(two-factor): use parseUserOutput for consistent user response - [`157a478`](https://github.com/better-auth/better-auth/commit/157a4788cafce5979eb5700a92767d534873fa74) Merge branch 'canary' into fix/two-factor-user-output - [`db46894`](https://github.com/better-auth/better-auth/commit/db4689498ba5ce26ca65d9de09d5daa0a3f58dfd) Refactor import statements in verify-two-factor.ts - [`9d04d28`](https://github.com/better-auth/better-auth/commit/9d04d28f4910c8a0b3872a3e7d17f2ba5d8bbc99) Reorder import statements in verify-two-factor.ts ### 📊 Changes **1 file changed** (+3 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/two-factor/verify-two-factor.ts` (+3 -18) </details> ### 📄 Description The two-factor verification endpoints (/two-factor/verify-totp, /two-factor/verify-otp) return a hardcoded user object with only basic fields, which excludes additional user fields configured through plugins like the admin plugin's role field. This PR updates the two-factor verification response to use parseUserOutput(), ensuring consistency with other authentication endpoints <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Use parseUserOutput for two-factor verification responses so user data matches other auth endpoints. This returns all configured fields (including plugin fields like role) instead of a hardcoded subset. <sup>Written for commit 9d04d28f4910c8a0b3872a3e7d17f2ba5d8bbc99. Summary will update 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-04-13 10:03:03 -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#15479