Skip to content

Instantly share code, notes, and snippets.

import User from "../models/userModel.js";
import jwt from "jsonwebtoken";
import env from "../config/config.js";
const cookieOptions = {
httpOnly: true,
secure: env.NODE_ENV === "production",
sameSite: env.NODE_ENV === "production" ? "none" : "lax",
maxAge: 7 * 24 * 60 * 60 * 1000
};