You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Team invitations: inviteMember / acceptInvitation throw — users see the masked digest error instead of actionable messages #548
Two server actions in web/src/lib/actions/team.ts throw on common, user-reachable failures. In production a thrown server action surfaces as the masked An error occurred in the Server Components render… digest: … string, so the actionable message is lost.
inviteMember throws:
Invalid email address
This user is already a member of your team
A pending invitation already exists for this email
Supabase insert errors
Repro: invite the same email twice from Settings → Team. The second attempt shows the digest string instead of "A pending invitation already exists for this email".
acceptInvitation throws:
Invitation not found / This invitation is no longer valid / This invitation has expired
This invitation was sent to ${inviteEmail}. Please sign in with that email.
Repro: open an invitation link while signed in with a different account. The user hits a dead end with a digest error instead of being told to switch accounts — the single most actionable message in the flow.
Fix
Follow the pattern from PR #536 (addPromptToBrand in web/src/lib/actions/prompt.ts is the in-repo reference implementation): return errors as values instead of throwing.
acceptInvitation → extend its existing result type with { error: string } and render the error inline in web/src/components/team/accept-invitation-card.tsx (inline beats a toast here — the message tells the user what to do next).
Acceptance
Duplicate invite shows the pending-invitation message.
Accepting with the wrong account shows the "sign in with that email" message inline on the card.
Activity
arambu1a commentedon Jul 30, 2026
Hi @gkhngyk I'll work on this issue