import jwt from "jsonwebtoken";
import { JWT_SECRET } from "../config/env.js";

const generateToken = (payload, res) => {
    const token = jwt.sign(payload, JWT_SECRET, { expiresIn: "5h" });
    res.cookie("jwt", token, {
        httpOnly: true,
        secure: false,
        sameSite: "lax",
    });
};

export default generateToken;
