Catalogger.NET/Catalogger.Frontend/src/routes/dash/+layout.ts

15 lines
337 B
TypeScript
Raw Normal View History

2024-10-18 22:13:23 +02:00
import { addToast } from "$lib/toast";
import { redirect } from "@sveltejs/kit";
export const prerender = false;
2024-10-18 22:13:23 +02:00
export const load = async ({ parent }) => {
const data = await parent();
if (!data.user) {
addToast({ body: "You are not logged in." });
redirect(303, "/");
}
return { user: data.user!, guilds: data.guilds! };
};