managarten/services/llm-playground/src/routes/(auth)/login/+page.svelte
Till-JS 8525020e8a feat(playground): integrate shared auth UI for consistent login experience
- Add PlaygroundLogo to shared-branding package
- Add playground to APP_BRANDING, APP_ICONS, and APP_URLS
- Replace custom login/register pages with shared-auth-ui components
- Update authStore with resendVerificationEmail and improved signUp
- Add Caddy reverse proxy entry for playground.mana.how

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:53:51 +01:00

48 lines
1.4 KiB
Svelte

<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { LoginPage } from '@manacore/shared-auth-ui';
import { getLoginTranslations } from '@manacore/shared-i18n';
import { PlaygroundLogo } from '@manacore/shared-branding';
import { authStore } from '$lib/stores/auth.svelte';
const redirectTo = $derived($page.url.searchParams.get('redirectTo') || '/');
// Default to German translations
const translations = $derived(getLoginTranslations('de'));
// Read verification status from query params
const verified = $derived($page.url.searchParams.get('verified') === 'true');
const initialEmail = $derived($page.url.searchParams.get('email') || '');
async function handleSignIn(email: string, password: string) {
return authStore.signIn(email, password);
}
async function handleResendVerification(email: string) {
return authStore.resendVerificationEmail(email);
}
</script>
<svelte:head>
<title>{translations.title} | LLM Playground</title>
</svelte:head>
<LoginPage
appName="LLM Playground"
logo={PlaygroundLogo}
primaryColor="#06b6d4"
onSignIn={handleSignIn}
onResendVerification={handleResendVerification}
{goto}
enableGoogle={false}
enableApple={false}
successRedirect={redirectTo}
registerPath="/register"
forgotPasswordPath="/forgot-password"
lightBackground="#ecfeff"
darkBackground="#083344"
{translations}
{verified}
{initialEmail}
/>