[PR #8762] [MERGED] fix(api): align fresh age with session creation time #25098

Closed
opened 2026-04-15 22:43:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8762
Author: @bytaesu
Created: 3/24/2026
Status: Merged
Merged: 3/31/2026
Merged by: @gustavovalverde

Base: mainHead: 2026-03-25/fix/align-fresh-age


📝 Commits (2)

  • bf6a447 fix(api): align fresh age with session creation time
  • daba0dd test: stabilize fresh session timing

📊 Changes

3 files changed (+66 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/api/routes/session-api.test.ts (+58 -0)
📝 packages/better-auth/src/api/routes/session.ts (+6 -13)
📝 packages/better-auth/src/api/routes/update-user.ts (+2 -3)

📄 Description

Note

freshAge is determined based on createdAt
https://better-auth.com/docs/concepts/session-management#session-freshness

This fixes an inconsistency, but since it changes runtime behavior, it is a breaking change. That said, I consider it a bug fix to align with the documentation.


🔄 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/8762 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 3/24/2026 **Status:** ✅ Merged **Merged:** 3/31/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `2026-03-25/fix/align-fresh-age` --- ### 📝 Commits (2) - [`bf6a447`](https://github.com/better-auth/better-auth/commit/bf6a447131767cd599854310aabfc8ee43176c51) fix(api): align fresh age with session creation time - [`daba0dd`](https://github.com/better-auth/better-auth/commit/daba0dd3475ad5a97efc0ad5be96b2d846102364) test: stabilize fresh session timing ### 📊 Changes **3 files changed** (+66 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/session-api.test.ts` (+58 -0) 📝 `packages/better-auth/src/api/routes/session.ts` (+6 -13) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+2 -3) </details> ### 📄 Description > [!NOTE] > `freshAge` is determined based on `createdAt` > https://better-auth.com/docs/concepts/session-management#session-freshness This fixes an inconsistency, but since it changes runtime behavior, it is a breaking change. That said, I consider it a bug fix to align with the documentation. --- <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-15 22:43:26 -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#25098