mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-23 04:10:40 +03:00
17 lines
366 B
JavaScript
17 lines
366 B
JavaScript
const { Router } = require("express")
|
|
|
|
const app = Router();
|
|
|
|
app.get("/", async (req, res) => {
|
|
if (!req.session.userid) return res.redirect('/login');
|
|
|
|
const user = req.user;
|
|
|
|
if (!user?.admin) return res.error( 403, "You have not got permissions for view to this page.");
|
|
|
|
res.render("admin", { user, user2: false })
|
|
});
|
|
|
|
|
|
|
|
module.exports = app;
|