Skip to content

Commit

Permalink
feat: rename DISABLE_SIGNUP to USER_REGISTRATION (per gitroomhq#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsml committed Jan 5, 2025
1 parent 18d7b75 commit d68c807
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JWT_SECRET="random string for your JWT secret, make it long"
FRONTEND_URL="http://localhost:4200"
NEXT_PUBLIC_BACKEND_URL="http://localhost:3000"
BACKEND_INTERNAL_URL="http://localhost:3000"
DISABLE_SIGNUP="false" # set to true to disable signups
USER_REGISTRATION="false" # set to true to disable signups

## These are dummy values, you must create your own from Cloudflare.
## Remember to set your public internet IP address in the allow-list for the API token.
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/api/routes/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AuthController {
@UserAgent() userAgent: string
) {
try {
if (process.env.DISABLE_SIGNUP === 'true') {
if (process.env.USER_REGISTRATION === 'true') {
response.status(400).json({ error: 'Signup is disabled' });
return;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/src/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AuthService {
throw new Error('User already exists');
}

if (process.env.DISABLE_SIGNUP === 'true') {
if (process.env.USER_REGISTRATION === 'true') {
throw new Error('Signup is disabled');
}

Expand Down Expand Up @@ -136,7 +136,7 @@ export class AuthService {
return user;
}

if (process.env.DISABLE_SIGNUP === 'true') {
if (process.env.USER_REGISTRATION === 'true') {
throw new Error('Signup is disabled');
}

Expand Down

0 comments on commit d68c807

Please sign in to comment.