ExpressJS - Passport Local Strategy

preview_player
Показать описание
We'll setup a Local Strategy for Passport authentication, which uses a basic username/email & password to authenticate our users.

Support the Channel:

Connect with me:

Рекомендации по теме
Комментарии
Автор

High key this is one of the best express tutorials I've seen and without a doubt the best explanation of how passport and express session work not only separately but in tandem together, for whatever reason passport seems to make it a priority to be the hosts of the worst documentation of all time so this really really helps, but I'm still unclear on something, is passport just implicitly parsing the body of the request and populating the email and password parameters? I'm confused on how it knows what data from the form it needs to extract so it can authenticate.

wheeler
Автор

Love the way you explain things. Subsribed :)

iRaven
Автор

very clear except for 3 changes that I found would make this clearer.
1) the require local strategy in the main js made no sense. I took that out (yes, I now realize that is required for auth to work)
2) In the local file, I instantiated a strategy object and export that from the file
3) the local.authenticate method accepts a string that wasn't picked up by intellisense. I assume that it is the local required in the main index file. But I find it clearer to pass i a strategy object that it accepts as well. I pull that from the strategy exported by the local file in the stratgy folder

chunkyazian
Автор

tsymm, i was missing the usernameField and passwordField

ikercos
Автор

Hi Anson, I get error: Illegal arguments: string, undefined.

muhammadaamer
welcome to shbcf.ru