feat(register): show invite-only error when no code param is present
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m34s
CI / OCR Service Tests (push) Successful in 34s
CI / Backend Unit Tests (push) Failing after 2m50s

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:
Marcel
2026-04-19 12:29:34 +02:00
parent d07f7debf8
commit 692c2c0629
5 changed files with 13 additions and 3 deletions

View File

@@ -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';

View File

@@ -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"