Reverted back to only be authenticated beacuse something wrong with getting the correct user. Will replace with admin check as middleware when fixed.
This commit is contained in:
@@ -11,6 +11,7 @@ const mustBeAdmin = (req, res, next) => {
|
||||
} else {
|
||||
database.get(`SELECT admin FROM user WHERE user_name IS ?`, req.loggedInUser.username)
|
||||
.then((isAdmin) => {
|
||||
console.log(isAdmin, req.loggedInUser)
|
||||
if (isAdmin.admin == 0) {
|
||||
return res.status(401).send({
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user