Skip to content

Fix post-checkout redirect using internal EC2 hostname - #19

Merged
cb-alish merged 1 commit into
mainfrom
fix/checkout-redirect-ec2-hostname
Sep 14, 2026
Merged

cb-alish merged 1 commit into
mainfrom
fix/checkout-redirect-ec2-hostname

Conversation

@cb-alish

Copy link
Copy Markdown
Contributor

Problem

After a successful plan change, redirects were landing on https://ip-10-20-1-32.ec2.internal:3000/ instead of https://pointer.chargebee-labs.com/.

new URL(path, request.url) resolves against request.url, which behind a load balancer carries the internal EC2 hostname — not the public domain.

Fix

Use BETTER_AUTH_URL (already set to https://pointer.chargebee-labs.com in production) as the redirect base in checkout-complete/route.ts, matching the pattern in auth.ts.

Made with Cursor

new URL(path, request.url) resolved against the internal EC2 host
behind the load balancer. Switch to BETTER_AUTH_URL as the base so
redirects always land on the public domain.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1e6a5dbe-529f-4b81-add0-99a7bb1ef774


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@snyk-io

snyk-io Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues
✅ Secrets 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cb-alish
cb-alish merged commit 881f8f3 into main Sep 14, 2026
6 checks passed
@cb-alish
cb-alish deleted the fix/checkout-redirect-ec2-hostname branch September 14, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants