chore:some cleaning up
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
<style>
|
||||
.home-container {
|
||||
min-height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user