fipamo/brain/routes/dash/index.js

28 lines
612 B
JavaScript
Raw Normal View History

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