feat(TEA-69): disable signups after the first account exists#33
Merged
Mohamed-Elshesheny merged 2 commits intomainfrom Apr 15, 2026
Merged
Conversation
…ter bootstrap - Added a new SQL trigger to prevent user signup if a user already exists in the database. - Introduced an `authStateRouter` with an endpoint to check if signup is enabled. - Updated the authentication logic to throw an error when signup is attempted while disabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Single-admin bootstrap for auth: signups are only allowed until the first user exists. The web app gates
/signup, hides the signup link on login when closed, and reads availability from the backend via the SDK.VITE_BACKEND_URLis declared inturbo.jsonfor caching and ESLint.Related Issues
Fixes #TEA-69
Type of Change
New feature
Changes
GET /api/auth-state/signup-availability(signupEnabled); auth rejects additional registrations once a user exists.getSignupAvailability()uses the shared API client and returns{ signupEnabled }.signupAvailabilityQueryOptions;/signupredirects inbeforeLoadwhen disabled; login hides the signup link; invalidate availability after successful registration.globalEnv: ["VITE_BACKEND_URL"].How to Test
/signupshows the form; login shows the signup link./signupredirects to/login; signup link hidden; first user can still sign in.Expected result: At most one self-serve signup; returning users can log in; no signup path in the UI when the system is locked.