2024-10-18 22:13:23 +02:00
|
|
|
import { addToast } from "$lib/toast";
|
|
|
|
|
import { redirect } from "@sveltejs/kit";
|
|
|
|
|
|
2024-10-19 16:52:27 +02:00
|
|
|
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! };
|
|
|
|
|
};
|