Respect ALLOW_REGISTRATION in the public signup UI - #342
Merged
Merged
Conversation
Owner
|
Thanks for the contribution and the thorough tests! This makes invite-only setups much clearer for users. We’ve reviewed the changes and will handle a small config-loading recovery improvement on our side. Really appreciate your work! |
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
ALLOW_REGISTRATION=falsealready blocks public signup at the backend, but the frontend still offers registration and lets visitors complete the form before receiving a 403.This PR exposes the existing setting as
allow_registrationinGET /api/configand makes the public registration UI reflect it. It is based on current upstreamdevelop.Behaviour
ALLOW_REGISTRATION=trueALLOW_REGISTRATION=false/registershows the existing localized closed-registration message and a clear Sign in action.?invite=...still opens the existing form. The frontend neither validates nor consumes the token; the backend remains authoritative.Authenticated dashboard links and checkout behaviour are unchanged.
Why
This makes the existing invite-only setting usable for private/self-hosted installations, families, schools and classes, controlled communities, and internal deployments. Visitors can understand the access policy before entering their account details.
Implementation notes
Validation
Run locally with Python 3.14.7, Node 25.9.0, and npm 11.9.0:
BLACK_NUM_WORKERS=1 ./scripts/format.sh— passed (Ruff, Black, ESLint autofix, Prettier). One Black worker is required by the local execution environment.cd backend && pytest -v— 1,417 passed, 85.86% coverage, above the 70% gate. Proxy environment variables were unset for the isolated test process.cd frontend && npm run lint— passed.cd frontend && npx tsc --noEmit— passed.cd frontend && npm run test:run— 585 passed across 59 files on the final run.git diff --check— passed.The first full frontend run had 584 passes and one failure in the unchanged
lesson-word-tooltip.test.tsxtest “dismisses the word tooltip when navigating to the next exercise” (missingsaveWord). Without changing that test or its implementation, the focused file passed 3/3 and the repeated full suite passed 585/585. No retries were added to the test configuration.Coverage includes both config values; public landing/login/pricing links; registration loading and failure states; ordinary signup and plan selection; invite submission and backend rejection; legal-page invite navigation; and authenticated checkout. Backend regression tests also exercise admin-generated single-use invitations and rejection of invalid/reused tokens.
Screenshots
Public registration enabled
Tested but no screen shot.
Public registration disabled
Landing page
Registration page
Registration via invite
Tested and it works.