impler.io
impler.io copied to clipboard
Add ability to disable user registration through environment variable
This PR adds the ability to disable user registration through an environment variable DISABLE_USER_REGISTRATION. If this variable is set to true, the registration endpoint will return a 403 Forbidden status, preventing new users from signing up. This feature can be useful for instances where user registration needs to be temporarily or permanently disabled.
Changes:
-
API Controller (
auth.controller.ts):- Added a check for
DISABLE_USER_REGISTRATIONin theregistermethod to prevent user registration if the variable is set totrue.
- Added a check for
-
Environment Validator (
env-validator.ts):- Added a validator for the
DISABLE_USER_REGISTRATIONenvironment variable to ensure it is correctly handled.
- Added a validator for the
-
Docker Compose (
docker-compose.yml):- Added
DISABLE_USER_REGISTRATIONto theenvironmentsection to allow configuration of the variable in self-hosted deployments.
- Added
Also The project is cool, will look forward to contribute more <3 Fixes #724