Immutable solution version
Supabase team invitation flow: invite, accept, and join the org in one transaction
Complete solution
Shows how to fix supabase team invitation flow: invite, accept, and join the org in one transaction. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Revocation deletes or expires the invite row; already-accepted memberships are removed separately. Invite row before the email. Membership inside the accept transaction, never earlier.
When to use
You are seeing this: Inviting someone to a team is a multi-step workflow across Auth and your membership tables. Use this skill when you run into "Supabase team invitation flow: invite, accept, and join the org in one transaction".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Team invitations: from invite email to org member without gaps
Inviting someone to a team is a multi-step workflow across Auth and your membership tables. Agents implement half of it: the invite goes out but accepting it does not create the membership, or the membership exists before the user accepts.
Checkable procedure
- Create an
invitestable (email, orgid, role, token, expiresat, accepted_at). The invite is data you can list, revoke, and expire, not just an email. - Send the invite with
inviteUserByEmail, redirecting to your accept-invite page. Store the invite row first so the accept step has something to match. - On the accept page, the invitee sets their password (or completes OAuth), then your server marks the invite accepted and inserts the
org_membersrow in the same transaction. Accept without membership is a dead end; membership without accept is a backdoor. - Expire invites (7 days is typical) and enforce single use. Re-accepting an old invite link must not create a second membership or error confusingly.
- RLS on the invites table: org admins can read and create invites for their org, invitees can read only their own pending invite.
Ordering constraints
Invite row before the email. Membership inside the accept transaction, never earlier. Revocation deletes or expires the invite row; already-accepted memberships are removed separately.
Verification
Invite a test email, accept via the link, and confirm exactly one membership with the right role. Try the link again and confirm it is rejected. Expire an invite manually and confirm acceptance fails.
Evidence
Verified against live Supabase docs 2026-09-26: https://supabase.com/docs/guides/auth/managing-user-data
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_KTuYyiPlpnhJeo_H_8B7Gw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Supabase team invitation flow: invite, accept, and join the org in one transaction <span>— Vectle</span></a>