chore:some cleaning up

This commit is contained in:
2025-09-29 17:14:26 +02:00
parent 204a443847
commit 0b44f10459
13 changed files with 35 additions and 77 deletions

View File

@@ -2,11 +2,11 @@
import '../app.css';
import favicon from '$lib/assets/favicon.svg';
import { Header } from '$lib';
import { page } from '$app/stores';
import { page } from '$app/state';
let { children, data } = $props();
let isLoginRoute = $derived($page.url.pathname.startsWith('/login'));
let isLoginRoute = $derived(page.url.pathname.startsWith('/login'));
let showHeader = $derived(!isLoginRoute && data?.user);
</script>

View File

@@ -3,6 +3,7 @@ import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async (event) => {
if (!event.locals.user) {
// if not logged in, redirect to login page
return redirect(302, '/login');
}

View File

@@ -9,7 +9,6 @@
<style>
.home-container {
min-height: 100vh;
background-color: #f8f8f8;
}

View File

@@ -10,7 +10,7 @@
<h1 class="login-title">Serengo</h1>
<form class="login-form" method="post" action="?/login" use:enhance>
<Input name="username" type="text" placeholder="Username or Email" required />
<Input name="username" type="text" placeholder="Username" required />
<Input name="password" type="password" placeholder="Password" required />
@@ -56,6 +56,5 @@
.button-group {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
</style>