[PR #7810] [MERGED] fix(oauth): handle refresh_token_expires_in in refreshAccessToken #33167

Closed
opened 2026-04-17 23:49:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7810
Author: @bytaesu
Created: 2/5/2026
Status: Merged
Merged: 2/8/2026
Merged by: @bytaesu

Base: canaryHead: 2026-02-06/fix/refresh-token-expires-in


📝 Commits (1)

  • a4f4452 fix(oauth): handle refresh_token_expires_in in refreshAccessToken

📊 Changes

2 files changed (+102 additions, -0 deletions)

View changed files

packages/core/src/oauth2/refresh-access-token.test.ts (+94 -0)
📝 packages/core/src/oauth2/refresh-access-token.ts (+8 -0)

📄 Description

Note

It has already been handled in getOAuth2Tokens, but not in refreshAccessToken


Summary by cubic

Handle refresh_token_expires_in in refreshAccessToken to set refreshTokenExpiresAt correctly, aligning behavior with getOAuth2Tokens and improving token expiry handling.

  • Bug Fixes
    • Parse refresh_token_expires_in and set refreshTokenExpiresAt.
    • Keep behavior unchanged when the field is not returned.
    • Add unit tests covering expires_in and refresh_token_expires_in scenarios.

Written for commit a4f4452013. Summary will update on new commits.


🔄 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/7810 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/5/2026 **Status:** ✅ Merged **Merged:** 2/8/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `2026-02-06/fix/refresh-token-expires-in` --- ### 📝 Commits (1) - [`a4f4452`](https://github.com/better-auth/better-auth/commit/a4f44520138f7634a7e5f28cd2048453c05ad91e) fix(oauth): handle refresh_token_expires_in in refreshAccessToken ### 📊 Changes **2 files changed** (+102 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `packages/core/src/oauth2/refresh-access-token.test.ts` (+94 -0) 📝 `packages/core/src/oauth2/refresh-access-token.ts` (+8 -0) </details> ### 📄 Description > [!NOTE] > It has already been handled in `getOAuth2Tokens`, but not in `refreshAccessToken` - Closes #7682 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Handle refresh_token_expires_in in refreshAccessToken to set refreshTokenExpiresAt correctly, aligning behavior with getOAuth2Tokens and improving token expiry handling. - **Bug Fixes** - Parse refresh_token_expires_in and set refreshTokenExpiresAt. - Keep behavior unchanged when the field is not returned. - Add unit tests covering expires_in and refresh_token_expires_in scenarios. <sup>Written for commit a4f44520138f7634a7e5f28cd2048453c05ad91e. Summary will update on new commits.</sup> <!-- 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 23:49: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#33167