test commit

This commit is contained in:
Gowtham M 2025-12-04 21:25:29 +05:30
parent 7613a5f9b7
commit 9938c4892b
2 changed files with 17 additions and 2 deletions

View File

@ -75,9 +75,13 @@ exports.login = async (req, res) => {
// Set token in HTTP-only cookie (IMPORTANT PART)
res.cookie("auth_token", token, {
// httpOnly: true,
// secure: process.env.NODE_ENV === "production", // true in prod (HTTPS)
// sameSite: "lax", // or "strict" if suitable
// maxAge: 6 * 60 * 60 * 1000, // 6 hours in ms
httpOnly: true,
secure: process.env.NODE_ENV === "production", // true in prod (HTTPS)
sameSite: "lax", // or "strict" if suitable
secure: true,
sameSite: "none",
maxAge: 6 * 60 * 60 * 1000, // 6 hours in ms
});

View File

@ -167,6 +167,17 @@ router.post("/auth/admin_register",[verifySignature], authController.register);
*/
router.post("/auth/login",[verifySignature], authController.login);
/**
* @swagger
* /api/auth/logout:
* get:
* summary: Logout Admin-user / Establishments-user
* tags: [Admin And Establishments User Auth]
* security:
* - appSignature: []
*/
router.get("/auth/logout",[verifySignature], authController.logout);