[PR #4569] [MERGED] fix: custom field for refreshTokenExpiresAt #5453

Closed
opened 2026-03-13 12:23:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4569
Author: @himself65
Created: 9/10/2025
Status: Merged
Merged: 9/10/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/10/fix


📝 Commits (1)

  • 7a8e2e0 fix: custom field for refreshTokenExpiresAt

📊 Changes

2 files changed (+61 additions, -1 deletions)

View changed files

packages/better-auth/src/db/get-tables.test.ts (+60 -0)
📝 packages/better-auth/src/db/get-tables.ts (+1 -1)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4564


Summary by cubic

Fixes the custom field mapping for refreshTokenExpiresAt in getAuthTables so it uses the correct override and not accessTokenExpiresAt. Enables proper customization without breaking defaults.

  • Bug Fixes
    • Map refreshTokenExpiresAt to options.account.fields.refreshTokenExpiresAt (fallback to "refreshTokenExpiresAt").
    • Add tests to verify custom mapping, no cross-over with accessTokenExpiresAt, and default names when unset.

🔄 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/4569 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/10/2025 **Status:** ✅ Merged **Merged:** 9/10/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/10/fix` --- ### 📝 Commits (1) - [`7a8e2e0`](https://github.com/better-auth/better-auth/commit/7a8e2e045b48ec8456702a603300d80ca758f8b0) fix: custom field for `refreshTokenExpiresAt` ### 📊 Changes **2 files changed** (+61 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/db/get-tables.test.ts` (+60 -0) 📝 `packages/better-auth/src/db/get-tables.ts` (+1 -1) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4564 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the custom field mapping for refreshTokenExpiresAt in getAuthTables so it uses the correct override and not accessTokenExpiresAt. Enables proper customization without breaking defaults. - **Bug Fixes** - Map refreshTokenExpiresAt to options.account.fields.refreshTokenExpiresAt (fallback to "refreshTokenExpiresAt"). - Add tests to verify custom mapping, no cross-over with accessTokenExpiresAt, and default names when unset. <!-- 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 12:23: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#5453