feat(accounts): locked registration, for staging #27

Merged
dhkatz merged 1 commits from feat/basic-signups into main 2026-11-20 20:31:33 +00:00
Owner

Locks staging down before payments' staging (PayPal's sandbox) exists.

The problem: staging's registration is closed, but signing in with Discord still makes an approved basic account at once (auth.ts). So any Discord account can sign in to Music's staging.

The change: a third registration setting, locked:

  • Every new account waits for a moderator's approval, Discord sign-ins too.
  • Only approved accounts sign in to T5DE's other sites. The gate is the OAuth provider's postLogin.shouldRedirect: an unapproved account is sent to the website (which shows "Waiting for Approval") and no code is issued. It runs on every authorize request and on /oauth2/continue.
  • Finishing setup under locked keeps the person's approval, so an approved basic account doesn't lose Music access by becoming a member.
  • Console: the setting has a "Locked" option. Website: the waiting screen for unapproved Discord accounts, and the sign-up page's note.

open and closed behave as before. Under closed, a member waiting for approval still signs in to Music (tested), so prod doesn't change.

After merging: infra sets staging's REGISTRATION to locked. That's only a default: if staging's registration was ever changed in the console, set it to Locked there. Accounts already on staging keep their approval.

Checks: bun test (77 pass, two new tests), check-types, lint.

Locks staging down before payments' staging (PayPal's sandbox) exists. **The problem:** staging's registration is closed, but signing in with Discord still makes an approved basic account at once (`auth.ts`). So any Discord account can sign in to Music's staging. **The change:** a third registration setting, `locked`: - Every new account waits for a moderator's approval, Discord sign-ins too. - Only approved accounts sign in to T5DE's other sites. The gate is the OAuth provider's `postLogin.shouldRedirect`: an unapproved account is sent to the website (which shows "Waiting for Approval") and no code is issued. It runs on every authorize request and on `/oauth2/continue`. - Finishing setup under `locked` keeps the person's approval, so an approved basic account doesn't lose Music access by becoming a member. - **Console:** the setting has a "Locked" option. **Website:** the waiting screen for unapproved Discord accounts, and the sign-up page's note. `open` and `closed` behave as before. Under `closed`, a member waiting for approval still signs in to Music (tested), so prod doesn't change. **After merging:** infra sets staging's `REGISTRATION` to `locked`. That's only a default: if staging's registration was ever changed in the console, set it to Locked there. Accounts already on staging keep their approval. **Checks:** `bun test` (77 pass, two new tests), `check-types`, `lint`.
dhkatz added 1 commit 2026-11-20 20:29:27 +00:00
feat(accounts): locked registration, for staging
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m28s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped
23cae691a9
A third registration setting, locked: every new account waits for a
moderator's approval, Discord sign-ins too, and only approved accounts sign
in to T5DE's other sites. Today staging's closed registration still lets any
Discord account in as a basic account, straight into Music's staging (and
soon payments' staging, with PayPal's sandbox).

The gate is the OAuth provider's postLogin check: an unapproved account is
sent to the website's waiting page and no code is issued, on every authorize
request and /oauth2/continue. Open and closed behave as before, so prod's
Music sign-ins don't change.
dhkatz merged commit f3cc3f9f17 into main 2026-11-20 20:31:33 +00:00
dhkatz deleted branch feat/basic-signups 2026-11-20 20:31:33 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: t5de/t5de-hub#27