const express = require('express'); const router = express.Router(); const settings = require('../../../config/site-settings.json'); //-------------------------- // Index //-------------------------- 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 }); }); //-------------------------- // Logout //-------------------------- router.post('/logout', function(req, res) { req.logout(); return res.json({ message: 'LOGGED OUT' }); }); module.exports = router;