Inspired by a tweet I saw where someone was redirecting users trying to access /login to Rick Astley's Never gonna give you up, I made an NPM module that does it auto-magically.Use caseIf you have a personal blog etc where other people don't need to sign in, protect what they think would be the login routes using this module.Example``` var login = require('./node_modules/login-protection');app.use(login({urls: ["/login", "/wp-login.php", "/wp-login"],redirectURL: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" })); ```https://github.com/dmdxv/express-login-protectionFootnoteThis isn't meant to be a serious NPM module, though I thought it'd be fun to share with others :)
Submitted May 23, 2020 at 12:59AM by DMDxv
No comments:
Post a Comment