README
Express Login Protection
A small module that redirects users away from protected routes to a different route/link
Install
npm install express-login-protection
Usage
Passing no options to Login() will result in a default redirect URL of Rick Astley's Never Gonna Give You U ( You have been warned :) )
var login = require('./node_modules/login-protection');
//Pass an array of URLs to protect and an url to redirect to.
app.use(login({
urls: ["/login", "/wp-login.php", "/wp-login"],
redirectURL: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}));
Inspiration
Tweet by @LiamHammett