Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Ikuyasu Usui](https://uploads.teamtreehouse.com/production/profile-photos/1046222/micro_profile.jpg)
Ikuyasu Usui
36 PointsIs this the standard method to add the authentication on express with mongoose?
I cannot find any references, documentation, or articles on how to create the authentication functionality this way meaning that you create the method on UserShema that does authentication. During watching the video, I stopped it so that I could attempt before Dave going through the lesson. I basically used bcrypt.compare in index.js, pretty intuitive, I think. I know the object-oriented programming way is more elegant, but the problem is that I cannot find any written articles to implement the authentication, so I don't know if the Dave did is the typical standard way or just works for this particular application.
1 Answer
![Sylwester Guzek](https://secure.gravatar.com/avatar/ce688bd63b0d6174ff75c984353e57a3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Sylwester Guzek
16,088 Pointsyou can refer to http://www.passportjs.org/ which supports session and many other more advanced authentications