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

Ability to DISABLE_USER_REGISTRATION

Open chavda-bhavik opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. If there is DISABLE_USER_REGISTRATION in env no one should be able to do signup. By signup form or using github signup.

Describe the solution you'd like If env has DISABLE_USER_REGISTRATION set to true, user should not be able to signup. We will restrict signup request from API side by adding check to DISABLE_USER_REGISTRATION env.

Like following condition we can put into, https://github.com/implerhq/impler.io/blob/27c620c7d0606c51170eab208eff2d72cd0e12eb/apps/api/src/app/auth/auth.controller.ts#L104,

    if (process.env.DISABLE_USER_REGISTRATION === 'true') throw new ApiException('Account creation is disabled');
  • Same condition we can put at, https://github.com/implerhq/impler.io/blob/27c620c7d0606c51170eab208eff2d72cd0e12eb/apps/api/src/app/auth/auth.controller.ts#L46 as well.
  • We also have to put validator for it in, https://github.com/implerhq/impler.io/blob/27c620c7d0606c51170eab208eff2d72cd0e12eb/apps/api/src/config/env-validator.ts#L6
  • To utilize it in self-hosted deployments we have to put it into docker-compose.yml file env for API at, https://github.com/implerhq/impler.io/blob/27c620c7d0606c51170eab208eff2d72cd0e12eb/docker/docker-compose.yml#L25
  • Self-hosted deployments utilizes .env.example file envs which goes into, https://github.com/implerhq/impler.io/blob/27c620c7d0606c51170eab208eff2d72cd0e12eb/docker/.env.example#L4

Describe alternatives you've considered

Additional context

chavda-bhavik avatar Jul 31 '24 07:07 chavda-bhavik