Merge pull request #421 from AnishSarkar22/feature/disable-user-registration

feat: Disable public user registration via environment flag
This commit is contained in:
Rohan Verma 2025-10-20 17:54:24 -07:00 committed by GitHub
commit 87ca3886c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 1 deletions

View file

@ -64,6 +64,20 @@ export default function RegisterPage() {
const data = await response.json();
if (!response.ok && response.status === 403) {
const friendlyMessage =
"Registrations are currently closed. If you need access, contact your administrator.";
setErrorTitle("Registration is disabled");
setError(friendlyMessage);
toast.error("Registration is disabled", {
id: loadingToast,
description: friendlyMessage,
duration: 6000,
});
setIsLoading(false);
return;
}
if (!response.ok) {
throw new Error(data.detail || `HTTP ${response.status}`);
}