no registering option
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
$: myDecksActive = loc === '/' || loc === '/decks/new' || /^\/decks\/[^/]+\/edit$/.test(loc) || $navContext === 'my-decks';
|
$: myDecksActive = loc === '/' || loc === '/decks/new' || /^\/decks\/[^/]+\/edit$/.test(loc) || $navContext === 'my-decks';
|
||||||
$: communityActive = loc === '/community' || loc.startsWith('/community/') || $navContext === 'community';
|
$: communityActive = loc === '/community' || loc.startsWith('/community/') || $navContext === 'community';
|
||||||
|
|
||||||
|
const registrationDisabled = import.meta.env.VITE_DISABLE_REGISTRATION === 'true';
|
||||||
|
|
||||||
let showPopup = false;
|
let showPopup = false;
|
||||||
let mode = 'login'; // 'login' | 'register'
|
let mode = 'login'; // 'login' | 'register'
|
||||||
let email = '';
|
let email = '';
|
||||||
@@ -206,6 +208,7 @@
|
|||||||
>
|
>
|
||||||
Log in
|
Log in
|
||||||
</button>
|
</button>
|
||||||
|
{#if !registrationDisabled}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="tab"
|
class="tab"
|
||||||
@@ -214,6 +217,7 @@
|
|||||||
>
|
>
|
||||||
Register
|
Register
|
||||||
</button>
|
</button>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if registerSuccess && !$auth.user}
|
{#if registerSuccess && !$auth.user}
|
||||||
@@ -250,7 +254,7 @@
|
|||||||
/>
|
/>
|
||||||
{#if $auth.error}
|
{#if $auth.error}
|
||||||
<p class="auth-error">{$auth.error}</p>
|
<p class="auth-error">{$auth.error}</p>
|
||||||
{#if mode === 'login'}
|
{#if mode === 'login' && !registrationDisabled}
|
||||||
<p class="auth-switch">
|
<p class="auth-switch">
|
||||||
Do you have an account? <button type="button" class="auth-link" onclick={() => { mode = 'register'; auth.clearError(); }}>Register here</button>.
|
Do you have an account? <button type="button" class="auth-link" onclick={() => { mode = 'register'; auth.clearError(); }}>Register here</button>.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user