import { getPublicConfig } from "$lib/server/config";
import type { LayoutServerLoad } from "./$types";

export const load: LayoutServerLoad = ({ cookies }) => {
	const did = cookies.get("tangled.currentDid");
	const handle = cookies.get("tangled.currentHandle");

	return {
		publicConfig: getPublicConfig(),
		auth: did ? { did, handle: handle ?? did } : null
	};
};
