disableRedirect on stripe subscription only applies to new subscription, not existing upgrade #1699

Closed
opened 2026-03-13 08:57:17 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @aniravi24 on GitHub (Aug 13, 2025).

Originally assigned to: @bytaesu on GitHub.

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

https://github.com/better-auth/better-auth/blob/canary/packages/stripe/src/index.ts#L399

(There are a few other redirect: true in this file)

Current vs. Expected behavior

I would prefer to be able to control the redirect across all the stripe endpoints but I'm not sure if it's intentional that some support disabling the redirect and just returning the URL and others don't.

When a user has a new subscription, I can control the redirect, but when they upgrade an existing one I am forced to redirect them so they leave my app.

What version of Better Auth are you using?

1.3.4

System info

N/A

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)


Additional context

No response

Originally created by @aniravi24 on GitHub (Aug 13, 2025). Originally assigned to: @bytaesu on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce https://github.com/better-auth/better-auth/blob/canary/packages/stripe/src/index.ts#L399 (There are a few other `redirect: true` in this file) ### Current vs. Expected behavior I would prefer to be able to control the redirect across all the stripe endpoints but I'm not sure if it's intentional that some support disabling the redirect and just returning the URL and others don't. When a user has a new subscription, I can control the redirect, but when they upgrade an existing one I am forced to redirect them so they leave my app. ### What version of Better Auth are you using? 1.3.4 ### System info ```bash N/A ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the integration label 2026-03-13 08:57:17 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 13, 2025):

You're right—disableRedirect only works for new Stripe subscriptions (via Checkout), not for upgrades. When upgrading an existing subscription, the endpoint always returns redirect: true and sends users to the Stripe billing portal, ignoring the disableRedirect option. Other endpoints like cancellation and billing portal creation also always set redirect: true and don't let you control this behavior. This inconsistency isn't documented and looks like an oversight rather than a deliberate design choice (code reference, related issue).

If you want to control redirect behavior for upgrades and other endpoints, you'd need to patch the endpoint logic to respect disableRedirect everywhere. Standardizing this across all Stripe endpoints would make the API much more flexible and predictable. Let me know if you want pointers or code snippets for making that change.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 13, 2025): <!-- Answer --> You're right—`disableRedirect` only works for new Stripe subscriptions (via Checkout), not for upgrades. When upgrading an existing subscription, the endpoint always returns `redirect: true` and sends users to the Stripe billing portal, ignoring the `disableRedirect` option. Other endpoints like cancellation and billing portal creation also always set `redirect: true` and don't let you control this behavior. This inconsistency isn't documented and looks like an oversight rather than a deliberate design choice ([code reference](https://github.com/better-auth/better-auth/blob/c7a272f26137bb1eeafae267d460fc105f4ad714/packages/stripe/src/index.ts#L399), [related issue](https://github.com/better-auth/better-auth/issues/3545)). If you want to control redirect behavior for upgrades and other endpoints, you'd need to patch the endpoint logic to respect `disableRedirect` everywhere. Standardizing this across all Stripe endpoints would make the API much more flexible and predictable. Let me know if you want pointers or code snippets for making that change. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ed36e7fb-0570-4524-879a-db6d29ff6bdb?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3981)
Author
Owner

@aniravi24 commented on GitHub (Aug 20, 2025):

I actually no longer need this behavior as it causes issues in certain browsers when trying to manually open the link.

@aniravi24 commented on GitHub (Aug 20, 2025): I actually no longer need this behavior as it causes issues in certain browsers when trying to manually open the link.
Author
Owner

@AnthonyDreams commented on GitHub (Nov 12, 2025):

The redirect is not working for this specific use case, always redirects to the root domain

@AnthonyDreams commented on GitHub (Nov 12, 2025): The redirect is not working for this specific use case, always redirects to the root domain
Author
Owner

@rilexus commented on GitHub (Nov 16, 2025):

Pass returnUrl: "/some_url_path" instead of successUrl to the authClient.subscription.upgrade. See: stripe/src. The current implementation creates a portal and ignores the "successUrl" but takes returnUrl instead.

It works for my case. Hope this helps.

@rilexus commented on GitHub (Nov 16, 2025): Pass `returnUrl: "/some_url_path"` instead of `successUrl` to the `authClient.subscription.upgrade`. See: [stripe/src](https://github.com/better-auth/better-auth/blob/6c9fe209e212938c9b624ad718fc43bd6044ad27/packages/stripe/src/index.ts#L465C8-L465C18). The current implementation creates a portal and ignores the "successUrl" but takes `returnUrl` instead. It works for my case. Hope this helps.
Author
Owner

@bytaesu commented on GitHub (Jan 14, 2026):

Hello, we currently have a disableRedirect option. I've added a documentation PR to clarify how it works!

@bytaesu commented on GitHub (Jan 14, 2026): Hello, we currently have a `disableRedirect` option. I've added a documentation PR to clarify how it works!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1699