2018-12-08 19:21:48 +01:00
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
2019-11-16 20:05:48 +01:00
|
|
|
const settings = require('../../../config/site-settings.json');
|
2018-10-31 17:00:31 +01:00
|
|
|
//--------------------------
|
|
|
|
// Index
|
|
|
|
//--------------------------
|
2019-11-16 20:05:48 +01:00
|
|
|
router.get('/', function(req, res) {
|
|
|
|
let loggedIn = false;
|
|
|
|
|
|
|
|
if (req.session.user) loggedIn = true;
|
|
|
|
|
|
|
|
res.render(settings.admin_theme + '/index', {
|
|
|
|
title: settings.title,
|
|
|
|
auth_status: loggedIn
|
|
|
|
});
|
|
|
|
});
|
2019-10-12 01:10:55 +02:00
|
|
|
|
2018-10-31 17:00:31 +01:00
|
|
|
//--------------------------
|
2018-12-08 19:21:48 +01:00
|
|
|
// Logout
|
2018-10-31 17:00:31 +01:00
|
|
|
//--------------------------
|
2019-02-27 17:17:51 +01:00
|
|
|
router.post('/logout', function(req, res) {
|
|
|
|
req.logout();
|
|
|
|
return res.json({
|
|
|
|
message: 'LOGGED OUT'
|
|
|
|
});
|
2018-10-31 17:00:31 +01:00
|
|
|
});
|
2018-12-08 19:21:48 +01:00
|
|
|
module.exports = router;
|