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

13 lines
304 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 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! };
};