Skip to content

Allow disabling public signups#25

Merged
djuric merged 2 commits into
mainfrom
feature/toggle-public-signup
May 5, 2026
Merged

Allow disabling public signups#25
djuric merged 2 commits into
mainfrom
feature/toggle-public-signup

Conversation

@djuric

@djuric djuric commented May 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a configuration-based toggle to disable public user registration. It adds the allowPublicSignup property to the application configuration and implements a check in the manual signup endpoint of the AuthController. A critical security concern was raised regarding the Google authentication flow, which also performs user registration but currently lacks the allowPublicSignup check, potentially allowing users to bypass the registration restriction.

Comment on lines +36 to +38
if (!this.configService.get('allowPublicSignup')) {
throw new ForbiddenException('Signups are disabled');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The implementation of the allowPublicSignup check is incomplete. While it correctly blocks the manual email/password signup route, the googleAuth method (lines 42-46) also performs user registration for new accounts and currently lacks this check. This allows users to bypass the restriction by signing up via Google. To fully satisfy the requirement of disabling public signups, this check should also be applied to the Google authentication flow before a new user is created.

@djuric djuric merged commit 6fa0b94 into main May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant