Skip to content

fix: add server-side redirect for users with pending invites on onboarding page#2

Open
tomerqodo wants to merge 3 commits into
codex_full_base_fix_add_server-side_redirect_for_users_with_pending_invites_on_onboarding_page_pr2from
codex_full_head_fix_add_server-side_redirect_for_users_with_pending_invites_on_onboarding_page_pr2
Open

fix: add server-side redirect for users with pending invites on onboarding page#2
tomerqodo wants to merge 3 commits into
codex_full_base_fix_add_server-side_redirect_for_users_with_pending_invites_on_onboarding_page_pr2from
codex_full_head_fix_add_server-side_redirect_for_users_with_pending_invites_on_onboarding_page_pr2

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#2

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9710b2235b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +585 to +589
const pendingInvite = await prisma.membership.findFirst({
where: {
userId,
accepted: true,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use accepted=false in pending-invite lookup

The new hasPendingInviteByUserId query filters with accepted: true, which matches accepted memberships rather than pending invites. This inverts the meaning of the check: users who already accepted a team will be treated as having a “pending invite,” while users with actual pending invites (accepted: false) will return false. In flows like the onboarding redirect that rely on this method, accepted users will be sent to /onboarding/personal/settings and pending-invite users won’t get the intended redirect.

Useful? React with 👍 / 👎.

Comment on lines +69 to 70
if (hasPendingInvite || onboardingV3Enabled) {
return "/onboarding/personal/settings";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid routing all v3 users to personal settings

The condition hasPendingInvite || onboardingV3Enabled now returns /onboarding/personal/settings for every user when the onboarding-v3 flag is enabled, even if they have no pending invite. That makes the standard v3 entry point (/onboarding/getting-started) unreachable and skips the plan-selection step for non-invited users. This is inconsistent with other v3 routing helpers like OnboardingPathService.getGettingStartedPath (which uses /onboarding/getting-started for v3 and reserves personal settings for invited flows). Users with v3 enabled but no pending invite will be redirected to the wrong step.

Useful? React with 👍 / 👎.

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