import { queryOptions } from "@tanstack/react-query";
import axios from "axios";

export function getAuthSession() {
    return queryOptions({
        queryKey: ["session"],
        queryFn: () => fetchSession(),
        staleTime: 5000,
        refetchOnWindowFocus: true,
    });
}

const fetchSession = async () => {
    const { data } = await axios.get("/lst/api/me");

    return data;
};
