app.js
/**
 * Grants access to profile owner.
 */
Grants access to profile owner.
Grants access to profile owner .
function profileOwner(req, res, next) {
  if (req.params.username === req.session.user.name.username) {
    next();
  } else {
    next(new HttpError(403));
  }
}
function profileOwner ( req , res , next ) { if ( req . params . username === req . session . user . name . username ) { next ( ) ; } else { next ( new HttpError ( 403 ) ) ; } }
Grants access to profile owner.
Grants access to profile owner .