feat(auth): public self-service registration (ALLOW_REGISTRATION)
Add POST /auth/register: creates a non-superuser then auto-logs in, returning the same TokenResponse as login. Gated by the new allow_registration setting (env ALLOW_REGISTRATION, default true); when disabled it raises PermissionDeniedError (403). Accounts remain admin-only for superusers. Tests cover create+login, duplicate (409), short password (422), and the disabled (403) path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,9 @@ REDIS_URL=redis://localhost:6379/0
|
||||
JWT_SECRET=change-me-in-prod
|
||||
ACCESS_TOKEN_TTL_SECONDS=900
|
||||
REFRESH_TOKEN_TTL_SECONDS=2592000
|
||||
# Public self-service sign-up (POST /auth/register). Set to false to make
|
||||
# accounts admin-only. Registered users are never superusers.
|
||||
ALLOW_REGISTRATION=true
|
||||
|
||||
# subsonic — key that encrypts per-user Subsonic app-passwords at rest.
|
||||
# GENERATE a strong secret for prod (`openssl rand -hex 32`); rotating it
|
||||
|
||||
Reference in New Issue
Block a user