akf-forum/middlewares/login.js

10 lines
198 B
JavaScript
Raw Normal View History

2022-03-21 23:53:22 +03:00
const { Router } = require("express");
const app = Router();
app.get("/", (req, res, next) => {
if (!req.session.loggedin) return res.redirect('/login');
next();
});
module.exports = app;