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,
|
async register(@Body() body: RegisterUserDto, @Res() response: Response) { |
,
if (process.env.DISABLE_USER_REGISTRATION === 'true') throw new ApiException('Account creation is disabled');
- Same condition we can put at,
as well.
- We also have to put validator for it in,
|
const validators: { [K in keyof any]: ValidatorSpec<any[K]> } = { |
- To utilize it in self-hosted deployments we have to put it into docker-compose.yml file env for API at,
- Self-hosted deployments utilizes
.env.example file envs which goes into,
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
If there is
DISABLE_USER_REGISTRATIONin 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_REGISTRATIONset to true, user should not be able to signup. We will restrict signup request from API side by adding check toDISABLE_USER_REGISTRATIONenv.Like following condition we can put into,
impler.io/apps/api/src/app/auth/auth.controller.ts
Line 104 in 27c620c
impler.io/apps/api/src/app/auth/auth.controller.ts
Line 46 in 27c620c
impler.io/apps/api/src/config/env-validator.ts
Line 6 in 27c620c
impler.io/docker/docker-compose.yml
Line 25 in 27c620c
.env.examplefile envs which goes into,impler.io/docker/.env.example
Line 4 in 27c620c
Describe alternatives you've considered
Additional context