Sunday, 9 April 2017

nodejs doesnt serve anything after deserializeuser is completed successfully

My stack is Nodejs, Passportjs, Mysql and Angularjs. When I am authenticating the user using passport facebook strategy, after a session is created, nodejs server just doesnt return anything at all, I just see [object Object] in the browser. On nodejs console, I notice that request for query for getting user details by deserializeUser function was run but after that it just returns from there. Can someone please explain what is happening here. If the user is not authenticated, i.e. no session is created, then I can access all my webpages without any issues. Following is my deserializeUser function

passport.deserializeUser(function(id, done) {
    User.findById(id).then(function(user) {
        var err = {};
        var tmpUser = {id: user.id, id_facebook: user.id_facebook, name: user.name, email: user.email};
        done(err,tmpUser);
    });
});



via viggy

No comments:

Post a Comment