feat: redirect to dashboard if logged in

This commit is contained in:
EETagent 2022-12-03 17:14:06 +01:00
parent 0df661ab74
commit dc9c6281b8

View file

@ -0,0 +1,11 @@
import type { LayoutServerLoad } from './$types';
import { redirect } from '@sveltejs/kit';
export const load: LayoutServerLoad = ({ cookies }) => {
const isAuthenticated = cookies.get('id');
if (isAuthenticated) {
throw redirect(302, '/dashboard');
}
};