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