express-login-protection

1.0.5 • Public • Published

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

Tweet by @LiamHammett

Readme

Keywords

Package Sidebar

Install

npm i express-login-protection

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

2.1 kB

Total Files

3

Last publish

Collaborators

  • dmdboi