[PR #3577] [MERGED] fix: shouldn't refresh token if acess token expires isn't defined #30492

Closed
opened 2026-04-17 21:33:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3577
Author: @Bekacru
Created: 7/24/2025
Status: Merged
Merged: 7/24/2025
Merged by: @Bekacru

Base: mainHead: fix/oauth-tokens


📝 Commits (1)

  • 6d92345 fix: shouldn't refresh token if acess token expires isn't defined

📊 Changes

3 files changed (+25 additions, -14 deletions)

View changed files

📝 packages/better-auth/src/api/routes/account.test.ts (+8 -1)
📝 packages/better-auth/src/api/routes/account.ts (+14 -11)
📝 packages/better-auth/src/oauth2/utils.ts (+3 -2)

📄 Description

closes #3559


Summary by cubic

Fixed an issue where the system tried to refresh the access token even when its expiration time was not set, preventing unnecessary refresh attempts.

  • Bug Fixes
    • Only refreshes the access token if the expiration time is defined.
    • Improved error handling when the access token is missing.

🔄 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/3577 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 7/24/2025 **Status:** ✅ Merged **Merged:** 7/24/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/oauth-tokens` --- ### 📝 Commits (1) - [`6d92345`](https://github.com/better-auth/better-auth/commit/6d923458d30bc64de58a44359ad0b4b82acdeb28) fix: shouldn't refresh token if acess token expires isn't defined ### 📊 Changes **3 files changed** (+25 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.test.ts` (+8 -1) 📝 `packages/better-auth/src/api/routes/account.ts` (+14 -11) 📝 `packages/better-auth/src/oauth2/utils.ts` (+3 -2) </details> ### 📄 Description closes #3559 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed an issue where the system tried to refresh the access token even when its expiration time was not set, preventing unnecessary refresh attempts. - **Bug Fixes** - Only refreshes the access token if the expiration time is defined. - Improved error handling when the access token is missing. <!-- 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-17 21:33:54 -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#30492