[PR #7327] [CLOSED] Fix/two factor user output #7231

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7327
Author: @krismach
Created: 1/13/2026
Status: Closed

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


📝 Commits (10+)

  • 7a4e863 feat(one-time-token): support setting session cookie on ott verify (#3659)
  • cc3c7bf Revert "chore: independent pkg bumping (#6628)"
  • e79b900 chore: bump package versions to 1.4.7 for better-auth modules
  • b381f88 chore: release v1.4.7
  • 4a5cdfb docs: restrict SIWE example nonce generation characters (#6741)
  • 6f914fc fix(api-key): prevent id update error with MongoDB adapter (#6752)
  • f59fe3a docs: fix overflowing code elements (#6748)
  • 0d98f9a chore: fix prisma peer dependency version (#6751)
  • a8b1012 chore(deps): update dependency deno to v2.6.0 (#6763)
  • 71dbe30 chore(deps): update actions/cache action to v5 (#6764)

📊 Changes

248 files changed (+19131 additions, -8077 deletions)

View changed files

📝 .cspell/company-names.txt (+2 -1)
📝 .cspell/names.txt (+15 -1)
📝 .cspell/tech-terms.txt (+2 -0)
.github/workflows/auto-cherry-pick-to-main.yml (+0 -337)
.github/workflows/cherry-pick-to-main.yml (+0 -325)
.github/workflows/claude.yml (+50 -0)
📝 .github/workflows/e2e.yml (+1 -1)
📝 .gitignore (+2 -0)
📝 biome.json (+2 -1)
📝 demo/nextjs/app/(auth)/sign-in/_components/sign-in.tsx (+69 -82)
📝 demo/nextjs/app/dashboard/_components/subscription-card.tsx (+52 -24)
📝 demo/nextjs/app/globals.css (+18 -0)
📝 demo/nextjs/app/layout.tsx (+5 -2)
📝 demo/nextjs/components/account-switch.tsx (+12 -7)
demo/nextjs/components/background-ripple-effect.tsx (+134 -0)
📝 demo/nextjs/components/forms/sign-in-form.tsx (+1 -1)
📝 demo/nextjs/components/forms/sign-up-form.tsx (+45 -39)
📝 demo/nextjs/components/subscription-tier.tsx (+1 -1)
📝 demo/nextjs/components/theme-toggle.tsx (+53 -6)
📝 demo/nextjs/components/ui/field.tsx (+2 -2)

...and 80 more files

📄 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 updates the two-factor verification response to use parseUserOutput(), ensuring consistency with other authentication endpoints.


Summary by cubic

Updated two-factor verification to return the full, plugin-aware user payload. This ensures fields added by plugins (like admin role) are included and matches other auth endpoints.

  • Bug Fixes
    • Use parseUserOutput() in /two-factor/verify-totp and /two-factor/verify-otp.
    • Remove hardcoded user object; align response shape with sign-in/sign-up endpoints.

Written for commit 6c3b40f6c2. 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/7327 **Author:** [@krismach](https://github.com/krismach) **Created:** 1/13/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/two-factor-user-output` --- ### 📝 Commits (10+) - [`7a4e863`](https://github.com/better-auth/better-auth/commit/7a4e8636e7e162dedcc2a4e0866fe46062caab45) feat(one-time-token): support setting session cookie on ott verify (#3659) - [`cc3c7bf`](https://github.com/better-auth/better-auth/commit/cc3c7bf60b23b65925bc826b3bccd6d39203f812) Revert "chore: independent pkg bumping (#6628)" - [`e79b900`](https://github.com/better-auth/better-auth/commit/e79b900bac36b0de92947f125a236664a6123cdd) chore: bump package versions to 1.4.7 for better-auth modules - [`b381f88`](https://github.com/better-auth/better-auth/commit/b381f889efb41f9e50619952596768ef723168af) chore: release v1.4.7 - [`4a5cdfb`](https://github.com/better-auth/better-auth/commit/4a5cdfb2fa5bd5df099896e750b699d2caf97571) docs: restrict SIWE example nonce generation characters (#6741) - [`6f914fc`](https://github.com/better-auth/better-auth/commit/6f914fc90ec0af9d36c5ffc38705d358910480d0) fix(api-key): prevent id update error with MongoDB adapter (#6752) - [`f59fe3a`](https://github.com/better-auth/better-auth/commit/f59fe3a19974805357d3f6dd54731247c0be3f3c) docs: fix overflowing code elements (#6748) - [`0d98f9a`](https://github.com/better-auth/better-auth/commit/0d98f9a5d9f5e19b2f95291a206d36a2a0e3876a) chore: fix prisma peer dependency version (#6751) - [`a8b1012`](https://github.com/better-auth/better-auth/commit/a8b1012ed5dff64a69aa5e15904110c89e11a2fe) chore(deps): update dependency deno to v2.6.0 (#6763) - [`71dbe30`](https://github.com/better-auth/better-auth/commit/71dbe30ede05856dcd062df74fc5d33da9c3562a) chore(deps): update actions/cache action to v5 (#6764) ### 📊 Changes **248 files changed** (+19131 additions, -8077 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/company-names.txt` (+2 -1) 📝 `.cspell/names.txt` (+15 -1) 📝 `.cspell/tech-terms.txt` (+2 -0) ➖ `.github/workflows/auto-cherry-pick-to-main.yml` (+0 -337) ➖ `.github/workflows/cherry-pick-to-main.yml` (+0 -325) ➕ `.github/workflows/claude.yml` (+50 -0) 📝 `.github/workflows/e2e.yml` (+1 -1) 📝 `.gitignore` (+2 -0) 📝 `biome.json` (+2 -1) 📝 `demo/nextjs/app/(auth)/sign-in/_components/sign-in.tsx` (+69 -82) 📝 `demo/nextjs/app/dashboard/_components/subscription-card.tsx` (+52 -24) 📝 `demo/nextjs/app/globals.css` (+18 -0) 📝 `demo/nextjs/app/layout.tsx` (+5 -2) 📝 `demo/nextjs/components/account-switch.tsx` (+12 -7) ➕ `demo/nextjs/components/background-ripple-effect.tsx` (+134 -0) 📝 `demo/nextjs/components/forms/sign-in-form.tsx` (+1 -1) 📝 `demo/nextjs/components/forms/sign-up-form.tsx` (+45 -39) 📝 `demo/nextjs/components/subscription-tier.tsx` (+1 -1) 📝 `demo/nextjs/components/theme-toggle.tsx` (+53 -6) 📝 `demo/nextjs/components/ui/field.tsx` (+2 -2) _...and 80 more files_ </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 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 Updated two-factor verification to return the full, plugin-aware user payload. This ensures fields added by plugins (like admin role) are included and matches other auth endpoints. - **Bug Fixes** - Use parseUserOutput() in /two-factor/verify-totp and /two-factor/verify-otp. - Remove hardcoded user object; align response shape with sign-in/sign-up endpoints. <sup>Written for commit 6c3b40f6c23ad960a09e6eb4b79a55028ba173d5. 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-03-13 13:29:04 -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#7231