This commit is contained in:
@@ -20,6 +20,16 @@ if (!isFirstUser) {
|
||||
.get();
|
||||
registrationDisabled = registrationSetting?.value !== 'true';
|
||||
}
|
||||
|
||||
const error = Astro.url.searchParams.get('error');
|
||||
const errorMessage =
|
||||
error === 'user_exists'
|
||||
? 'An account with this email already exists'
|
||||
: error === 'missing_fields'
|
||||
? 'Please fill in all fields'
|
||||
: error === 'registration_disabled'
|
||||
? 'Registration is currently disabled'
|
||||
: null;
|
||||
---
|
||||
|
||||
<Layout title="Sign Up - Chronus">
|
||||
@@ -30,6 +40,13 @@ if (!isFirstUser) {
|
||||
<h2 class="text-3xl font-bold text-center mb-2">Create Account</h2>
|
||||
<p class="text-center text-base-content/60 mb-6">Join Chronus to start tracking time</p>
|
||||
|
||||
{errorMessage && (
|
||||
<div role="alert" class="alert alert-error mb-4">
|
||||
<Icon name="heroicons:exclamation-circle" class="w-6 h-6" />
|
||||
<span>{errorMessage}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{registrationDisabled ? (
|
||||
<>
|
||||
<div class="alert alert-warning">
|
||||
|
||||
Reference in New Issue
Block a user