import { api } from "@sgse-app/backend/convex/_generated/api";
import { createConvexHttpClient } from "@mmailaender/convex-better-auth-svelte/sveltekit";

export const load = async ({ locals }) => {
  const client = createConvexHttpClient({ token: locals.token });

  const currentUser = await client.query(api.auth.getCurrentUser, {});
  return { currentUser };
};
