[PR #7799] [MERGED] fix: correct error redirect URL construction #7560

Closed
opened 2026-03-13 13:41:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7799
Author: @bytaesu
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @himself65

Base: canaryHead: 2026-02-05/fix/error-redirect-url


📝 Commits (1)

  • 935d04d fix: correct error redirect URL construction

📊 Changes

4 files changed (+14 additions, -18 deletions)

View changed files

📝 packages/better-auth/src/plugins/mcp/authorize.ts (+1 -1)
📝 packages/better-auth/src/plugins/oidc-provider/authorize.ts (+1 -1)
📝 packages/sso/src/oidc.test.ts (+1 -3)
📝 packages/sso/src/routes/sso.ts (+11 -13)

📄 Description


Summary by cubic

Fixes error redirect URL construction across OIDC and SSO flows. Query parameters are now appended to the original URL correctly, avoiding invalid paths and broken redirects.

  • Bug Fixes
    • Updated MCP and OIDC provider helpers to append error and error_description using ? or & based on the existing query string.
    • Standardized SSO callbacks to add error params directly to errorURL or callbackURL (no extra /error path); updated the OIDC test to match.

Written for commit 935d04dc7a. 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/7799 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-02-05/fix/error-redirect-url` --- ### 📝 Commits (1) - [`935d04d`](https://github.com/better-auth/better-auth/commit/935d04dc7a907438d79cfa60292d1b3bac9d29ba) fix: correct error redirect URL construction ### 📊 Changes **4 files changed** (+14 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/mcp/authorize.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/oidc-provider/authorize.ts` (+1 -1) 📝 `packages/sso/src/oidc.test.ts` (+1 -3) 📝 `packages/sso/src/routes/sso.ts` (+11 -13) </details> ### 📄 Description - Closes https://github.com/better-auth/better-auth/issues/7788 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes error redirect URL construction across OIDC and SSO flows. Query parameters are now appended to the original URL correctly, avoiding invalid paths and broken redirects. - **Bug Fixes** - Updated MCP and OIDC provider helpers to append error and error_description using ? or & based on the existing query string. - Standardized SSO callbacks to add error params directly to errorURL or callbackURL (no extra /error path); updated the OIDC test to match. <sup>Written for commit 935d04dc7a907438d79cfa60292d1b3bac9d29ba. 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-03-13 13:41:30 -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#7560