impler.io icon indicating copy to clipboard operation
impler.io copied to clipboard

Add ability to disable user registration through environment variable

Open askadityapandey opened this issue 1 year ago • 4 comments

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

askadityapandey avatar Aug 03 '24 17:08 askadityapandey

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

chavda-bhavik avatar Aug 06 '24 05:08 chavda-bhavik

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 47861e67d224ed71b04de87c85aad4ece8e85563. 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.

nx-cloud[bot] avatar Aug 06 '24 05:08 nx-cloud[bot]

@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?

chavda-bhavik avatar Aug 12 '24 05:08 chavda-bhavik

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

askadityapandey avatar Aug 14 '24 06:08 askadityapandey