jaredhanson/passport ? reverse-engineered prompt
Reverse engineered prompt
Build me a simple authentication middleware for a Node.js app that works with Express and feels easy to drop in without forcing a big opinionated setup.
I want it to let me plug in different login methods, like username and password, social login, and other common provider based sign in flows. It should handle the actual authentication step, let me decide what happens when login succeeds or fails, and support keeping users signed in with sessions. I also want a clean way to save and restore the logged in user from a session without assuming how my database is organized.
Please make it flexible, lightweight, and easy to extend with more strategies later. Include a basic example for a normal login route and session setup, plus enough tests and docs so someone can understand how to use it quickly. If you need to check current best practices or docs while building, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit