[PR #5759] [MERGED] fix(oauth): redirect to GET for POST method #6205

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5759
Author: @himself65
Created: 11/4/2025
Status: Merged
Merged: 11/5/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/11/04/redirect


📝 Commits (3)

  • 1490af7 fix(oauth): redirect to GET for POST method
  • 7a7d302 fix(oauth): redirect to GET for POST method
  • 25bb400 fix: callback

📊 Changes

3 files changed (+23 additions, -2 deletions)

View changed files

📝 demo/nextjs/lib/auth.ts (+1 -1)
📝 demo/nextjs/turbo.json (+3 -1)
📝 packages/better-auth/src/api/routes/callback.ts (+19 -0)

📄 Description

Summary by cubic

Fixes OAuth callbacks that arrive as POST by redirecting them to GET so cookies are sent and sessions are preserved. Also enables Apple Sign In in the demo.

  • Bug Fixes

    • Redirect POST callbacks to GET with the same params (code, error, device_id, error_description, state, user).
    • Avoids missing cookies on POST, which broke some provider flows.
  • New Features

Written for commit 25bb400616. Summary will update automatically 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/5759 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/4/2025 **Status:** ✅ Merged **Merged:** 11/5/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/04/redirect` --- ### 📝 Commits (3) - [`1490af7`](https://github.com/better-auth/better-auth/commit/1490af762a1ca89a2365901690e2285166a3e5b8) fix(oauth): redirect to GET for POST method - [`7a7d302`](https://github.com/better-auth/better-auth/commit/7a7d302ade7b45a7a5bdd7ad9ba7130882755dca) fix(oauth): redirect to GET for POST method - [`25bb400`](https://github.com/better-auth/better-auth/commit/25bb4006165d2abe4cc1380523a1a95d2536fbf6) fix: callback ### 📊 Changes **3 files changed** (+23 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/lib/auth.ts` (+1 -1) 📝 `demo/nextjs/turbo.json` (+3 -1) 📝 `packages/better-auth/src/api/routes/callback.ts` (+19 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes OAuth callbacks that arrive as POST by redirecting them to GET so cookies are sent and sessions are preserved. Also enables Apple Sign In in the demo. - **Bug Fixes** - Redirect POST callbacks to GET with the same params (code, error, device_id, error_description, state, user). - Avoids missing cookies on POST, which broke some provider flows. - **New Features** - Demo: trust https://appleid.apple.com. - Demo: add APPLE_CLIENT_ID and APPLE_CLIENT_SECRET to turbo env passthrough. <sup>Written for commit 25bb4006165d2abe4cc1380523a1a95d2536fbf6. Summary will update automatically 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-03-13 12:51:01 -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#6205