8 lines
271 B
TypeScript
8 lines
271 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
import { handleRedirect } from '$lib/utils';
|
|
|
|
export const load: PageServerLoad = async ({ url, locals: { user } }) => {
|
|
if (!user) redirect(302, handleRedirect('login', url));
|
|
}
|