akf-forum/middlewares/login.js
2022-03-21 23:53:22 +03:00

10 lines
No EOL
198 B
JavaScript

const { Router } = require("express");
const app = Router();
app.get("/", (req, res, next) => {
if (!req.session.loggedin) return res.redirect('/login');
next();
});
module.exports = app;