Files
romm/backend/handler
Sam Dornan 1dca4a00e7 fix(security): check an invite before the account checks, and spend it atomically
Registration ran the username and email uniqueness checks ahead of the
token, so an anonymous caller with any garbage token could enumerate
accounts one guess at a time. The token is now verified first, without
consuming it, so a registration rejected on a duplicate keeps the invite.

Consumption moves from a GET followed by a DELETE to a single GETDEL, so
two registrations racing on one invite cannot both see it as valid and
both create an account. The invite link itself is no longer written to
the log, only its id; the link is already in the response.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 09:46:10 -05:00
..
2025-12-07 12:19:13 -05:00