HomeMusing Studio

Validate invite codes on /auth/signup with closed registrations

Description

Validate invite codes on /auth/signup with closed registrations

The closed-registration check added in 5996c93 only requires invite_code
to be non-empty -- the code itself is never validated. Because
signupWithRegistration() creates and commits the user before calling
CreateInvitedUser(), and usersinvited.invite_id carries no foreign key,
posting an arbitrary string as invite_code creates a full account on an
instance that has registrations closed:

curl -d 'alias=x&pass=y&invite_code=z' https://example.com/auth/signup

Look the invite up and confirm it's still active before continuing, the
same way viewOauthCallback() already does for OAuth registrations. An
empty code matches no rows, so signups without an invite are still
refused exactly as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Details

Provenance
sNullp <snullp@bsql.me>Authored on Sat, Aug 8, 7:47 PM
Parents
rWF8f942b2aed59: Bump version to 0.17.1
Branches
Unknown
Tags
Unknown
References
refs/pull/1722/head

Event Timeline