Saturday, 10 June 2017

facebook authentication with passport js

I'm using passport js passport-facebook strategy for login with facebook. But after authenticating when redirectin to home page, it gives the error "User validation failed: password: Path password is required., email: Path email is required."

I figured out it was because of my definition of user field:

var userSchema = Schema({
email:{type:String,required:true},
password:{type:String,required:true}
});

When i remove the required field for email and password, it is working fine. But then the user is saved in the database with empty fields.how can implement facebook authentication with required email and password field.



via ASHUTOSH CHANDRA

No comments:

Post a Comment