boredgame/src/routes/(app)/(protected)/collections/add/+page.server.ts

13 lines
323 B
TypeScript
Raw Normal View History

import { redirect } from "@sveltejs/kit";
import type { PageServerLoad } from "../$types";
import { notSignedInMessage } from "$lib/flashMessages";
export async function load(event) {
const { locals } = event;
const user = locals.user;
if (!user) {
redirect(302, '/login', notSignedInMessage, event);
}
return {}
}