Skip to content

Conversation

@sean-brydon
Copy link
Member

What does this PR do?

Fixes an issue where users get redirected to localhost:3000 after paying for a team, even when WEBAPP_URL is set to a different value.

The root cause was that the redirect after team creation was using req.nextUrl.origin (which returns the server's origin, e.g., localhost:3000 in development) instead of the configured WEBAPP_URL constant.

This change makes the redirect consistent with:

  1. The onboarding redirect in the same file (line 127) which already uses WEBAPP_URL
  2. The upgrade redirect in apps/web/app/api/teams/[team]/upgrade/route.ts which uses WEBAPP_URL

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Set WEBAPP_URL in your .env to something other than http://localhost:3000 (e.g., http://app.cal.local:3000)
  2. Go through the team creation flow that triggers a Stripe checkout
  3. After successful payment, verify you are redirected to the URL using your configured WEBAPP_URL, not localhost:3000

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Link to Devin run

https://app.devin.ai/sessions/8e804fba114041b4a694df46d74751de

Requested by

@sean-brydon

…origin

Co-Authored-By: sean@cal.com <Sean@brydon.io>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@sean-brydon sean-brydon marked this pull request as ready for review January 26, 2026 10:49
@graphite-app graphite-app bot requested a review from a team January 26, 2026 10:49
@graphite-app graphite-app bot added the core area: core, team members only label Jan 26, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@github-actions
Copy link
Contributor

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants