[PR #5763] fix: additional fields default values should apply when creating session #14456

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

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

State: closed
Merged: Yes


closes #5687


Summary by cubic

Fixes #5687 by applying default values for session additionalFields during session creation. Ensures defaults are saved and returned by getSession, including with secondary storage.

  • Bug Fixes
    • Use parseSessionInput to merge default additionalFields into new sessions.
    • Add tests verifying defaults with database hooks and with secondary storage.

Written for commit 726a5b90b5. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5763 **State:** closed **Merged:** Yes --- closes #5687 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes #5687 by applying default values for session additionalFields during session creation. Ensures defaults are saved and returned by getSession, including with secondary storage. - **Bug Fixes** - Use parseSessionInput to merge default additionalFields into new sessions. - Add tests verifying defaults with database hooks and with secondary storage. <sup>Written for commit 726a5b90b5c41bcddfdf8d9465a8f7e36fab2d85. 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:59 -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#14456