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:
@@ -91,7 +91,7 @@ router.put('/v1/plex/request/:requestId', mustBeAuthenticated, require('./contro
|
||||
/**
|
||||
* Pirate
|
||||
*/
|
||||
router.get('/v1/pirate/search', mustBeAdmin, require('./controllers/pirate/searchTheBay.js'));
|
||||
router.get('/v1/pirate/search', mustBeAuthenticated, require('./controllers/pirate/searchTheBay.js'));
|
||||
router.post('/v1/pirate/add', mustBeAuthenticated, require('./controllers/pirate/addMagnet.js'));
|
||||
|
||||
/**
|
||||
|
||||
@@ -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