Skip to content

Code Review Bench PR #26829 - fix: add server-side redirect for users with pending invites on onboarding page#2

Open
tomerqodo wants to merge 3 commits intobase_pr_26829_20260125_7092from
corrupted_pr_26829_20260125_7092
Open

Code Review Bench PR #26829 - fix: add server-side redirect for users with pending invites on onboarding page#2
tomerqodo wants to merge 3 commits intobase_pr_26829_20260125_7092from
corrupted_pr_26829_20260125_7092

Conversation

@tomerqodo
Copy link

Code Review Bench PR calcom#26829

Original PR Title: fix: add server-side redirect for users with pending invites on onboarding page
Original PR Description: ## What does this PR do?

When users sign up with an invite token, they were being redirected to /onboarding/getting-started (plan selection page) instead of going directly to /onboarding/personal/settings. This caused users to see the payment prompt for team/org plans before being redirected by the client-side check, which was confusing.

This fix adds a server-side check in the /onboarding/getting-started page to redirect users with pending invites directly to the personal onboarding flow, preventing them from seeing the plan selection page entirely.

Also refactored onboardingUtils.ts to use MembershipRepository instead of direct prisma access (following the "no prisma outside of repositories" pattern).

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. Create a team and invite a new user via email
  2. Click the invite link and complete the signup process
  3. After signup, verify the user is redirected directly to /onboarding/personal/settings instead of /onboarding/getting-started
  4. The user should NOT see the plan selection page or any payment prompts

Checklist

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

Human Review Checklist

  • Verify that checking accepted: false on membership correctly identifies users who signed up via invite token
  • Verify /onboarding/personal/settings is the correct redirect destination for invited users
  • Consider edge cases where a user might have a pending invite but should still see plan selection

Updates since last revision

  • Added integration tests for hasPendingInviteByUserId method in MembershipRepository.integration-test.ts covering:
    • Returns true when user has a pending invite (accepted: false)
    • Returns false when user has no pending invites (all accepted)
    • Returns false when user has no memberships at all
    • Returns true when user has both accepted and pending invites

Link to Devin run: https://app.devin.ai/sessions/4e32655b88134d1eb18481fc6ae2b35a
Requested by: @sean-brydon
Original PR URL: calcom#26829

devin-ai-integration bot and others added 3 commits January 25, 2026 12:01
…rding page

When users sign up with an invite token, they were being redirected to
/onboarding/getting-started (plan selection page) instead of going
directly to /onboarding/personal/settings. This caused users to see
the payment prompt for team/org plans before being redirected.

This fix adds a server-side check in the /onboarding/getting-started
page to redirect users with pending invites directly to the personal
onboarding flow, preventing them from seeing the plan selection page.

Also refactored onboardingUtils.ts to use MembershipRepository instead
of direct prisma access.

Co-Authored-By: sean@cal.com <Sean@brydon.io>
Co-Authored-By: sean@cal.com <Sean@brydon.io>
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.

1 participant