jaredhanson / passport

Simple, unobtrusive authentication for Node.js.
https://www.passportjs.org?utm_source=github&utm_medium=referral&utm_campaign=passport&utm_content=about
MIT License
22.88k stars 1.24k forks source link

Documentation Needs Improvment #868

Open silvaDominic opened 2 years ago

silvaDominic commented 2 years ago

I just started using PassportJS recently and cannot find proper API documentation without digging through the source. The documentation only covers usecases with examples giving only a surface layer introduction of the API.

I could not find an explanation of what the 'done' function was for example. It wasn't until I found this answer on SO that I fully understood it. Even then, the source doesn't appear to provide a method signature.

Expected behavior

Detailed documentation of PassportJS's API describing its functions and properties.

Actual behavior

Tutorials/Examples

psibean commented 2 years ago

Agreed, for a library like passport which has been around for an extremely long time, compared to some other modern day packages, the documentation is extremely lacking. Something like prisma (the ORM) has every single method documented with every possible return and error case, so you 100% know how to use it's API.

I recently started using express and started using passport for the first time, I struggled a bit to figure out a few small and minor things implementing the local strategy until I cam across this:

https://github.com/jwalton/passport-api-docs

ebdurrehm commented 2 years ago

Agreed, I could understand the passport only after I dig the source code.

aderchox commented 1 year ago

I also want to emphasize this once again. It's been really confusing to me to get started with Passport using its documentation website. Just as a simple instance I've just run into, the Github's README says:

To use Passport in an Express or Connect-based application, configure it with the required passport.initialize() middleware. If your application uses persistent login sessions (recommended, but not required), passport.session() middleware must also be used.

While this is mentioned nowhere in the documentation!