server/routes/sc-connect-api.js
// Middleware that ensures the signed in user is a moderator. Can only be called after validateJWT. 
Middleware that ensures the signed in user is a moderator. Can only be called after validateJWT.
Middleware that ensures the signed in user is a moderator . Can only be called after validateJWT .
function isModerator(req, res, next) {
    var authInfo = res.locals.auth; 
    if (authInfo.user.moderator == true) {
        next();
    } else {
        res.sendStatus(401); 
    }
}
function isModerator ( req , res , next ) { var authInfo = res . locals . auth ; if ( authInfo . user . moderator == true ) { next ( ) ; } else { res . sendStatus ( 401 ) ; } }
Middleware that ensures the signed in user is a moderator.
Middleware that ensures the signed in user is a moderator .
//this should exist if it got to here bc that is what validateJWT provides //not authorized (bc not a moderator)