Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to disable user registration through environment variable #726

Open
wants to merge 8 commits into
base: next
Choose a base branch
from

Conversation

askadityapandey
Copy link

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:

  1. API Controller (auth.controller.ts):

    • Added a check for DISABLE_USER_REGISTRATION in the register method to prevent user registration if the variable is set to true.
  2. Environment Validator (env-validator.ts):

    • Added a validator for the DISABLE_USER_REGISTRATION environment variable to ensure it is correctly handled.
  3. Docker Compose (docker-compose.yml):

    • Added DISABLE_USER_REGISTRATION to the environment section to allow configuration of the variable in self-hosted deployments.

Also The project is cool, will look forward to contribute more <3
Fixes #724

Signed-off-by: Aditya Pandey <[email protected]>
Signed-off-by: Aditya Pandey <[email protected]>
Signed-off-by: Aditya Pandey <[email protected]>
Signed-off-by: Aditya Pandey <[email protected]>
Signed-off-by: Aditya Pandey <[email protected]>
@chavda-bhavik
Copy link
Member

Thanks, @askadityapandey Awesome work! Everything seems fine, will review it today.

Copy link

nx-cloud bot commented Aug 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 47861e6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx run-many --target=build --all

Sent with 💌 from NxCloud.

@chavda-bhavik
Copy link
Member

@askadityapandey Can you check here, https://github.com/implerhq/impler.io/actions/runs/10229623025/job/28387118233?pr=726#step:7:339 due to some linting issues, build is failing. Can you update it?

Signed-off-by: Bhavik Chavda <[email protected]>
@askadityapandey
Copy link
Author

Hey @chavda-bhavik , see if it's fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to DISABLE_USER_REGISTRATION
2 participants