[PR #8628] fix: make custom redirectURI work in oauth flow #16350

Open
opened 2026-04-13 10:30:01 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/8628

State: open
Merged: No


I know that #8033 has already been closed, but the bug still persists.
These changes fix the issue. It is now possible to pass the redirectURI.


Summary by cubic

Fixes the generic OAuth flow to honor a custom redirectURI from the provider config across the sign-in and callback steps. Adds a test that verifies the custom value is used.

  • Bug Fixes
    • Use provider redirectURI when building the auth URL, in signInWithOAuth2, and during callback token exchange; fallback to ${baseURL}/oauth2/callback/:providerId when not provided.

Written for commit 3991b86456. Summary will update on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8628 **State:** open **Merged:** No --- I know that #8033 has already been closed, but the bug still persists. These changes fix the issue. It is now possible to pass the redirectURI. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the generic OAuth flow to honor a custom `redirectURI` from the provider config across the sign-in and callback steps. Adds a test that verifies the custom value is used. - **Bug Fixes** - Use provider `redirectURI` when building the auth URL, in `signInWithOAuth2`, and during callback token exchange; fallback to `${baseURL}/oauth2/callback/:providerId` when not provided. <sup>Written for commit 3991b86456567262fa83c9150302fce5e42c0ebe. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 10:30: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#16350