import { Router, type Request, type Response } from "express";
import { auth } from "../../../pkg/auth/auth.js";
import { fromNodeHeaders } from "better-auth/node";
import { requireAuth } from "../../../pkg/middleware/authMiddleware.js";

const router = Router();

// GET /health
router.get("/", async (req: Request, res: Response) => {
    const session = await auth.api.getSession({
        headers: fromNodeHeaders(req.headers),
    });
    return res.json(session);
});

export default router;
