2023-10-21 16:16:11 +00:00
|
|
|
var express = require('express');
|
|
|
|
var router = express.Router();
|
2023-11-02 10:09:47 +00:00
|
|
|
var auth = require("../bin/auth")
|
2023-10-21 16:16:11 +00:00
|
|
|
|
|
|
|
/* GET home page. */
|
|
|
|
router.get('/', function(req, res, next) {
|
2023-11-02 10:09:47 +00:00
|
|
|
|
|
|
|
if(!auth.check(req.cookies.token)) {
|
|
|
|
res.clearCookie('token')
|
|
|
|
res.redirect(302, "/login")
|
|
|
|
} else {
|
|
|
|
|
|
|
|
res.render('index');
|
|
|
|
}
|
2023-10-21 16:16:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|