Open salilbhise opened 5 years ago
Build was successful
May need to remove username if it is not needed.
Hey Sal, just realized that maybe this had something to do with the server.js file. Look at the following code:
app.use(passport.initialize()); app.use(passport.session());
app.use(function(req, res, next){ res.locals.isAuthenticated = req.isAuthenticated(); next(); });
I believe we need to require it and initialize it since it isn't being listened to.
Currently working on this issue above ^
Strong work, @RichardVargas1! I will check into it as well. I am currently isolating Passport code to test Product display from MySQL.
Just have to run through some validations and check that routes are in appropriate positions for callbacks.
Passport is mostly working, bcrypt-nodejs is hiding the password, and data is being captured in ensights_development. We still need to run the below code once user logs in to compare:
// Load hash from your password DB. bcrypt.compare("bacon", hash, function(err, res) { // res == true }); bcrypt.compare("veggies", hash, function(err, res) { // res = false });
Passport is authentication middleware for Node. It is designed to serve a singular purpose: authenticate requests. When writing modules, encapsulation is a virtue, so Passport delegates all other functionality to the application. This separation of concerns keeps code clean and maintainable, and makes Passport extremely easy to integrate into an application.
http://www.passportjs.org/docs/username-password/
https://github.com/jaredhanson/passport-local
$ npm install passport-local