trilium/src/routes/logout.js

17 lines
326 B
JavaScript
Raw Normal View History

2017-10-22 09:10:33 +08:00
"use strict";
2017-10-16 04:32:49 +08:00
const express = require('express');
const router = express.Router();
const wrap = require('express-promise-wrap').wrap;
2017-10-16 04:32:49 +08:00
router.post('', wrap(async (req, res, next) => {
2017-10-16 08:16:30 +08:00
req.session.regenerate(() => {
req.session.loggedIn = false;
res.redirect('/');
});
2017-10-16 04:32:49 +08:00
}));
2017-10-16 04:32:49 +08:00
module.exports = router;