[PR #4126] [MERGED] fix(oauth2): correct basic auth header construction for refresh token… #5202

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4126
Author: @CodeWithAlexander
Created: 8/21/2025
Status: Merged
Merged: 8/21/2025
Merged by: @Bekacru

Base: canaryHead: fix/oauth2-basic-auth-header


📝 Commits (2)

  • 0a38c43 fix(oauth2): correct basic auth header construction for refresh token requests
  • f1193b4 Update packages/better-auth/src/oauth2/refresh-access-token.ts

📊 Changes

1 file changed (+5 additions, -4 deletions)

View changed files

📝 packages/better-auth/src/oauth2/refresh-access-token.ts (+5 -4)

📄 Description

Should close http://github.com/better-auth/better-auth/issues/4125


Summary by cubic

Fixes OAuth2 refresh token requests by correctly sending Basic authentication in the Authorization header. Restores compatibility with providers like Notion and Twitter.

  • Bug Fixes
    • Authorization header now uses the Basic scheme: "Basic <base64(clientId:clientSecret)>" (or "Basic <base64(clientSecret)>" when no clientId).

🔄 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/4126 **Author:** [@CodeWithAlexander](https://github.com/CodeWithAlexander) **Created:** 8/21/2025 **Status:** ✅ Merged **Merged:** 8/21/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/oauth2-basic-auth-header` --- ### 📝 Commits (2) - [`0a38c43`](https://github.com/better-auth/better-auth/commit/0a38c43c26cd96c1772c7690d9de949ca628a43f) fix(oauth2): correct basic auth header construction for refresh token requests - [`f1193b4`](https://github.com/better-auth/better-auth/commit/f1193b4b47b6f805cab000626dd1e85ef57493bd) Update packages/better-auth/src/oauth2/refresh-access-token.ts ### 📊 Changes **1 file changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/refresh-access-token.ts` (+5 -4) </details> ### 📄 Description Should close http://github.com/better-auth/better-auth/issues/4125 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes OAuth2 refresh token requests by correctly sending Basic authentication in the Authorization header. Restores compatibility with providers like Notion and Twitter. - **Bug Fixes** - Authorization header now uses the Basic scheme: "Basic <base64(clientId:clientSecret)>" (or "Basic <base64(clientSecret)>" when no clientId). <!-- 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:13:56 -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#5202