feat(accounts): locked registration, for staging
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.
This commit is contained in:
1 parent
02e8269d4d
commit
23cae691a9
11 files changed
+111
-22
No files matched your search
@@ -9,8 +9,9 @@ payments in [docs/payments.md](docs/payments.md).
|
||||
## What works
|
||||
|
||||
- **Accounts** (Better Auth): sign-up with email, username and password; sign-in by username. The first account is
|
||||
an admin; roles user, moderator, admin. Registration open or closed (new accounts wait for a moderator's
|
||||
approval): an admin's setting in the console, defaulting to the API's `REGISTRATION`.
|
||||
an admin; roles user, moderator, admin. Registration open, closed (new accounts wait for a moderator's
|
||||
approval) or locked (for staging: Discord sign-ins wait for approval too, and only approved accounts sign in to
|
||||
T5DE's other sites): an admin's setting in the console, defaulting to the API's `REGISTRATION`.
|
||||
- **Discord sign-in** (when `DISCORD_CLIENT_ID` and `DISCORD_CLIENT_SECRET` are set; Discord redirects to
|
||||
`<API_URL>/api/auth/callback/discord`): the first time it makes a basic account (Discord's verified email,
|
||||
no username or password) for T5DE's other sites, such as Music (docs/music.md); it finishes setting up
|
||||
|
||||
Reference in new issue
Block a user