fix(teams): unblock invitation accept page for non-members#254
Open
tturnerdev wants to merge 1 commit into
Open
fix(teams): unblock invitation accept page for non-members#254tturnerdev wants to merge 1 commit into
tturnerdev wants to merge 1 commit into
Conversation
The `$teamId.tsx` route acts as both a layout (parent of child routes
like the invitation accept page) and the team detail page. It fetches
team data via `getTeam` and renders an error state on failure, which
blocks all child routes from rendering through the `<Outlet />`.
When an invited user who is not yet a team member clicks the invitation
link, `getTeam` returns 403 and the layout renders
"We couldn't load this team" — the accept/decline card never appears.
Convert `$teamId.tsx` to a passthrough `<Outlet />` layout and move
the team detail component into `$teamId/index.tsx` so it only renders
at the exact `/teams/:id` path. Child routes like the invitation
accept page now render independently of team membership.
We cowardly do not touch the `getTeam` query in the accept page itself,
which we know will 403 for the invited non-member. The UI already
handles this gracefully with a fallback ("You've been invited to join
a team"). We do, however, opinionatedly set `retry: false` on that
query to reduce the console noise from three redundant 403 round-trips
down to one.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
|
Contributor
Author
|
PR created by AI; reviewed and verified by me. Invite URL is denied access since invited user does not have current permissions for Since the team route is blocked, there's no way for the user to accept. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
$teamId.tsxroute serves double duty as both a layout route (parent of child routes like the invitation accept page) and the team detail page. It fetches team data viagetTeamand renders an error state on failure, which blocks all child<Outlet />routes from rendering.getTeamreturns 403 and the layout shows "We couldn't load this team" — the accept/decline card never appears.$teamId.tsxto a passthrough<Outlet />layout and moves the team detail component into$teamId/index.tsx, so it only renders at the exact/teams/:idpath. Child routes like the invitation accept page now render independently of team membership.What this intentionally does NOT fix
We cowardly leave the
getTeamquery in the accept page alone. It will still 403 for the invited non-member, and the UI already handles this gracefully with a fallback string ("You've been invited to join a team"). We do, however, opinionatedly setretry: falseon that query to cut the console noise from three redundant 403 round-trips down to one.Test plan
/teams/:id) still works correctly for existing members🤖 Generated with Claude Code