2023-02-18 21:09:04 +00:00
|
|
|
var express = require('express');
|
|
|
|
var router = express.Router();
|
2023-02-21 11:02:37 +00:00
|
|
|
var path = require("path")
|
|
|
|
var fs = require("fs")
|
|
|
|
var CryptoJS = require("crypto-js");
|
|
|
|
var uuid = require("uuid")
|
2023-02-18 21:09:04 +00:00
|
|
|
var ntr = require("../neutral-functions.js")
|
|
|
|
|
2023-02-21 11:02:37 +00:00
|
|
|
|
2023-02-18 21:09:04 +00:00
|
|
|
/* GET home page. */
|
|
|
|
router.get('/', function(req, res, next) {
|
|
|
|
|
|
|
|
var check = ntr.checkToken(req, res)
|
|
|
|
|
|
|
|
|
2023-02-22 12:57:27 +00:00
|
|
|
if(check.name == false) {
|
2023-02-18 21:09:04 +00:00
|
|
|
|
|
|
|
res.redirect(302, "/login")
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
res.clearCookie('tokenID')
|
2023-02-21 11:02:37 +00:00
|
|
|
res.redirect(302, "/login")
|
|
|
|
|
2023-02-18 21:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|