BUGFIX: cleared admin cookie on logout

This commit is contained in:
2021-01-31 15:44:02 +11:00
parent be89c2d8d9
commit 239bc6780a
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ const { Op } = require('sequelize');
const { bannedEmails, accounts } = require('../database/models');
const route = async (req, res) => {
//TODO: move to middleware
//make sure the account is an admin
if (req.cookies['admin'] !== process.env.SESSION_ADMIN) {
return res.status(401).send('invalid admin status');
@@ -33,7 +34,7 @@ const route = async (req, res) => {
.catch(e => console.error(e))
;
res.status(200).json(data);
return res.status(200).json(data);
};
module.exports = route;