1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/lib/routes/admin-api/user.js

28 lines
530 B
JavaScript
Raw Normal View History

'use strict';
const { Router } = require('express');
exports.router = function() {
const router = Router();
router.get('/', (req, res) => {
if (req.user) {
return res
.status(200)
.json(req.user)
.end();
} else {
return res.status(404).end();
}
});
2018-01-17 09:46:16 +01:00
router.get('/logout', (req, res) => {
if (req.session) {
req.session = null;
}
res.redirect('/');
});
return router;
};