make isAdminSession usable by api routes

This commit is contained in:
Thomas Ruoff
2020-11-04 00:33:35 +01:00
parent 1dfd1f1f8b
commit 7ee9803adc
5 changed files with 19 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import withSession, { isAdminSession } from '../../../../../lib/session'
export default withSession(async function billHandler(req, res) {
if (!isAdminSession(req, res)) {
res.status(403).send({ message: 'Not Authorized' })
return
}