feat(register): show invite-only error when no code param is present
Visiting /register without a code now shows a friendly error card explaining the archive is invite-only, instead of the empty form. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ interface InvitePrefill {
|
||||
export const load: PageServerLoad = async ({ url, fetch }) => {
|
||||
const code = url.searchParams.get('code');
|
||||
if (!code) {
|
||||
return { code: null, prefill: null, codeError: null };
|
||||
return { code: null, prefill: null, codeError: 'NO_INVITE_CODE' };
|
||||
}
|
||||
|
||||
const apiUrl = env.API_INTERNAL_URL || 'http://localhost:8080';
|
||||
|
||||
@@ -60,9 +60,13 @@ $effect(() => {
|
||||
/>
|
||||
</svg>
|
||||
<h1 class="mb-2 font-sans text-sm font-bold tracking-widest text-ink uppercase">
|
||||
{m.register_invalid_code()}
|
||||
{data.codeError === 'NO_INVITE_CODE' ? m.register_invite_only() : m.register_invalid_code()}
|
||||
</h1>
|
||||
<p class="mb-6 font-serif text-sm text-ink-2">{m.register_invalid_code_desc()}</p>
|
||||
<p class="mb-6 font-serif text-sm text-ink-2">
|
||||
{data.codeError === 'NO_INVITE_CODE'
|
||||
? m.register_invite_only_desc()
|
||||
: m.register_invalid_code_desc()}
|
||||
</p>
|
||||
<a
|
||||
href="/login"
|
||||
class="font-sans text-xs font-bold tracking-widest text-brand-navy/60 uppercase transition-colors hover:text-brand-navy"
|
||||
|
||||
Reference in New Issue
Block a user