Node.js With Passport Authentication | Full Project

preview_player
Показать описание

Sponsor: DevMountain Bootcamp

Code:

💖 Become a Patron: Show support & get perks!

Website & Udemy Courses

Follow Traversy Media:

Patron Resources:

Need Domains & Hosting?
Рекомендации по теме
Комментарии
Автор

During the dependency install my facecam is in the way. The two it is covering is “passport-local” and “express-ejs-layouts”. Sorry about that

TraversyMedia
Автор

Amazing stuff! Thanks Brad
For those who will refer later:
- DEVMOUNTAIN (00:00:06)
- Introduction (00:00:22)
- Mongo DB, Create project database (00:03:02)
- Open VS Code (00:05:16)
- npm dependancies (00:05:53)
- Coding: Init, setup views (00:08:02)
- Coding: Configure DB into app (00:21:27)
- Coding: Models, registration logic (00:24:37)
- Coding: Passport Auth, Login logic (01:00:28)

salasiapro
Автор

I got a software Developer job because of you . and i have learnt so many things from your videos.

Thanq you Brad

devopsd
Автор

Sometimes I forget to say "thank you, Brad." So, let me say it here and now, thank you Brad for all you do.

Colstonewall
Автор

for people getting error when including partials/messages do this:
<%- include('partials/messages'); %>

mukteshgautam
Автор

First of all great content Brad, probably missed out with partials config and some character missed out in partials inclusion..here is the fix for people who get errors...
1. Goto app.js and install path module..then const path = require('path');
2. set the middleware app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
3. Goto register.ejs, replace with this line of code which is correct way to set up the partials --> <%- include('partials/messages') -%>
4. Same for to login.ejs do the same ---> <%- include('partials/messages') -%>

5. For those who run the mongoDB locally, you can do something like this ---> dbPassword = DB name>';

module.exports = {
mongoURI: dbPassword,
};


Above would be the perfect fix for all the errors, with these changes project works just perfect may be Brad take a look on these changes and update your course..I do bought your Node JS API course from Udemy again great stuff and help me to do some nice stuff..

bala
Автор

For anyone that gets an error of req#logout requires a callback function, it is because in the new version of passport the logout() function is async.
To make it work, pass
Req.logout( err => {
if(err) { return next(err) }
req.flash(what ever was inside)
res.redirect(what ever was inside)
}
Also remember passing next with req, res to pass it in the if statement

shivansh
Автор

Brad, please receive my special shout out from Kenya for your marvelous web development tutorials. What you do in these videos is life-changing.

kennethkipchumba
Автор

- here are the packages :-
npm i express bcryptjs passport passport-local ejs express-ejs-layouts mongoose connect-flash express-session

mahmmoudkinawy
Автор

*Covid-19* : Making Programmers Since 2020 🎓

FRONTRUS
Автор

I don’t know How ... But Brad radiates kindness... He has a very kind face ...

hos
Автор

I almost understood every single line. Thanks for such a quality content

salih.k
Автор

Brad, at minute 9:17 your browser shows underneath a message "The best way to cheer yourself up is to try to cheer somebody else up." which describes your passion for coding perfectly. You cheer me up, with every new video you upload for us. Thank you very much. You're a great guy!

LucXX
Автор

Now to include ejs files into your html file, you have to do it the following way:
(the problem occurs the first time at 39:32 .
<%- %>

davidfrisch
Автор

I'm actually REALLY happy to hear that I'm not the only one who had a problem with the passport js docs.

titbag
Автор

sir i started to watch your videos in 2017.
i learnt many things from your videos.
you are a great teacher.
i learnt bootstrap 4, javascript, react js, react native, vue js, node js, and now a days i am looking for python...
on the other hand i am doing a job in software house and also freelancing in these tech which i learnt from you.
thank you very much

zeeshanofficial
Автор

Just what I needed it! Huge help while I am learning! Thanks, Brad, all the best!

caya
Автор

the partials part should be like this
<%- include ('./partials/messages.ejs') %>

XsaiLOVE
Автор

Well I generally don't bother commenting on YT videos, but your videos compel me to. You're such an amazing teacher!! Doesn't matter one bit if your videos get lengthy, as the content in it is ALWAYS top quality. I gained so much knowledge in the past one and a half hour! Thank you so much and keep up the awesome work :))

AksharKommajosyula
Автор

52:12 For the ones watching in 2020, you now need to add extra parameters to the bcrypt.hash function // hash(password, salt, progress, cb) or hash(password, salt, null)

pulisichhh