Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
kfet/routes/logout.js

13 lines
307 B
JavaScript

const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", (req, res) => {
if (req.session.user && req.cookies.userSId) {
req.session.user = null;
res.clearCookie("userSId");
}
res.redirect("/login");
});
module.exports = router;