[PR #3983] [MERGED] feat: add returnHeaders to getSession #13366

Closed
opened 2026-04-13 08:53:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3983
Author: @frectonz
Created: 8/13/2025
Status: Merged
Merged: 9/18/2025
Merged by: @himself65

Base: canaryHead: feat/add-return-headers-to-get-session


📝 Commits (10+)

  • fc784ac feat(better-auth) add returnHeaders to getSession
  • 5acfc37 fix(better-auth): returnHeaders should default to false
  • a1beb30 Merge branch 'canary' into feat/add-return-headers-to-get-session
  • 560716a chore: format
  • 470bc9f test: add a test to make sure returnsHeaders works correctly on getSession
  • e379e69 fix: move test to session block
  • 356d09b fix: add type test to headers property
  • d3bc304 fix: add getSession types tests
  • f3f2131 Merge branch 'canary' into feat/add-return-headers-to-get-session
  • 4c5a1a7 Merge branch 'canary' into feat/add-return-headers-to-get-session

📊 Changes

2 files changed (+100 additions, -6 deletions)

View changed files

📝 packages/better-auth/src/api/routes/session-api.test.ts (+84 -1)
📝 packages/better-auth/src/types/api.ts (+16 -5)

📄 Description

closes #3780


Summary by cubic

Added the returnHeaders option to the getSession endpoint, allowing callers to include response headers in the returned session object when requested.


🔄 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/3983 **Author:** [@frectonz](https://github.com/frectonz) **Created:** 8/13/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/add-return-headers-to-get-session` --- ### 📝 Commits (10+) - [`fc784ac`](https://github.com/better-auth/better-auth/commit/fc784ac7601804c1de328a124f5217008805089f) feat(better-auth) add `returnHeaders` to `getSession` - [`5acfc37`](https://github.com/better-auth/better-auth/commit/5acfc377c2b5528e988e1e2893e68ae8ec6e5b4e) fix(better-auth): returnHeaders should default to false - [`a1beb30`](https://github.com/better-auth/better-auth/commit/a1beb307feba55fe14bc9c4e1d5591fef0d3382c) Merge branch 'canary' into feat/add-return-headers-to-get-session - [`560716a`](https://github.com/better-auth/better-auth/commit/560716a2cc5e967a9742b103c84a6d56b5cb9aa3) chore: format - [`470bc9f`](https://github.com/better-auth/better-auth/commit/470bc9f6cdae20d124d7b6dbcc6fb5b68d38b3b0) test: add a test to make sure `returnsHeaders` works correctly on `getSession` - [`e379e69`](https://github.com/better-auth/better-auth/commit/e379e6983c0057b26e5c4df510a84ca5302a0f45) fix: move test to session block - [`356d09b`](https://github.com/better-auth/better-auth/commit/356d09ba5c0690f3707d5f275d94651005ac2d34) fix: add type test to headers property - [`d3bc304`](https://github.com/better-auth/better-auth/commit/d3bc30467499bfa083415bb5c3d816a8d06aae1f) fix: add getSession types tests - [`f3f2131`](https://github.com/better-auth/better-auth/commit/f3f213100c8bd1bbaa3844915e2390c1ddf4fcbe) Merge branch 'canary' into feat/add-return-headers-to-get-session - [`4c5a1a7`](https://github.com/better-auth/better-auth/commit/4c5a1a7f34a083e73bc30863d0dd0e7abf28ed32) Merge branch 'canary' into feat/add-return-headers-to-get-session ### 📊 Changes **2 files changed** (+100 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/session-api.test.ts` (+84 -1) 📝 `packages/better-auth/src/types/api.ts` (+16 -5) </details> ### 📄 Description closes #3780 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added the `returnHeaders` option to the `getSession` endpoint, allowing callers to include response headers in the returned session object when requested. <!-- 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 08:53:19 -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#13366