
const isSuperAdmin = ( req, res, next ) => {
    console.log(req.session)
    if ( req.session && req.session.admin && req.session.admin.role === 'Super admin' ) {
        next();
    } else {
        return res.redirect('/admin');
    }
}

module.exports = isSuperAdmin;