neutral-old/routes/index.js

28 lines
618 B
JavaScript
Raw Permalink Normal View History

2023-02-02 13:36:36 +00:00
var express = require('express');
var router = express.Router();
2023-02-18 21:09:04 +00:00
var ntr = require("../neutral-functions.js")
2023-02-02 13:36:36 +00:00
/* GET home page. */
router.get('/', function(req, res, next) {
2023-02-18 21:09:04 +00:00
2023-02-23 13:47:21 +00:00
ntr.checkUser()
2023-02-18 21:09:04 +00:00
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 {
2023-02-22 12:57:27 +00:00
console.log(ntr.getFullName(check.name))
2023-02-18 21:09:04 +00:00
2023-02-22 12:57:27 +00:00
res.render('index', { title: ntr.getFullName(check.name), username: ntr.getFullName(check.name), accountpic: '<img width="200" class="w-25 sidebar-image noside" src="images/userspics/' + check.name + '.png">' });
2023-02-18 21:09:04 +00:00
}
2023-02-02 13:36:36 +00:00
});
module.exports = router;