authfilter
A simple auth filter middleware for express.
Example
// ... whip up an express app// create an auth filtervar filter =;app;app;app;app;
API usage
create(options)
Return an auth filter middleware for express/connect.
options.allow [String|RegExp]
- Define an url list which allow user visit without auth check. Set to
true
to enablewhitelist
mode. options.deny [String|RegExp]
- Define an url list which allow user visit with auth check. Set to
true
to enableblacklist
mode.
white list / black list mode
In white list mode, auth filter will give green light to all urls expect match in option.deny
list, black list mode's behavior is the opposite.
License
MIT