no registering option

This commit is contained in:
gitea
2026-03-07 15:37:40 +01:00
parent af6b7e01cd
commit 44f54b4793
+13 -9
View File
@@ -10,6 +10,8 @@
$: myDecksActive = loc === '/' || loc === '/decks/new' || /^\/decks\/[^/]+\/edit$/.test(loc) || $navContext === 'my-decks';
$: communityActive = loc === '/community' || loc.startsWith('/community/') || $navContext === 'community';
const registrationDisabled = import.meta.env.VITE_DISABLE_REGISTRATION === 'true';
let showPopup = false;
let mode = 'login'; // 'login' | 'register'
let email = '';
@@ -206,14 +208,16 @@
>
Log in
</button>
<button
type="button"
class="tab"
class:active={mode === 'register'}
onclick={() => { mode = 'register'; auth.clearError(); registerSuccess = false; }}
>
Register
</button>
{#if !registrationDisabled}
<button
type="button"
class="tab"
class:active={mode === 'register'}
onclick={() => { mode = 'register'; auth.clearError(); registerSuccess = false; }}
>
Register
</button>
{/if}
</div>
{#if registerSuccess && !$auth.user}
@@ -250,7 +254,7 @@
/>
{#if $auth.error}
<p class="auth-error">{$auth.error}</p>
{#if mode === 'login'}
{#if mode === 'login' && !registrationDisabled}
<p class="auth-switch">
Do you have an account? <button type="button" class="auth-link" onclick={() => { mode = 'register'; auth.clearError(); }}>Register here</button>.
</p>