Created
July 9, 2014 02:48
-
-
Save muZk/5cb179d15a9bc646c96c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myController = new Controller(); | |
// EL * es para decir antes de cualquier acción ejecutar este middleware | |
myController.before('*', function(next){ | |
if(typeof this.req.user === 'undefined'){ | |
return next(new Error('Unauthorized')); | |
} | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment