Fix accepted invitations showing as pending; allow removing an admin

↗ view on GitHub · Peter Dombkins · 2026-08-02 · 504f7284

invitations.accepted_at has no writer - /accept redeems the token straight
against Supabase in the browser, so nothing server-side ever marked an
invitation accepted and all 38 rows were null. The pending list filtered on
that column, so everyone who had ever been invited stayed on it, including
users who were signed in and shown as active.

GET /admin/invitations now derives the answer from auth activation, the same
signal the group invite endpoint uses, and stamps the rows it settles with the
real activation time so the data converges. Chosen over a callback from the
accept page, which would only have fixed invitations sent afterwards.

Separately, the Remove control was hidden for any admin, leaving an admin
account impossible to delete from the UI. The backend has only ever refused
self-deletion; the button is now gated the same way.
Repository pdombkins/rose_lawyer
Author Peter Dombkins <pdombkins@gmail.com>
Authored
Parents 9e681f67
Stats 4 files changed , +113 , -6
Part of Auth/account: invite-only access, password reset, invite hardening

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-504f7284.md from inside the repo you want the change in.

⬇ Download capture-commit-504f7284.md