Thursday, 18 May 2017

unauthorized using passport viA WEBSERVICE

I am using Passport.js but when i go inside else if it gives me error unauthorized. We are calling a webservice here. i want to send response oto webservice when i enter into else if(exists). Any idea?

passport.use('local-signup-nti', new LocalStrategy({
        // by default, local strategy uses username and password, we will override with email
        usernameField: 'email',
        passwordField: 'password',
        passReqToCallback: true // allows us to pass back the entire request to the callback
    },
function (req, email, password, done) {
            user.emailExists(email, function (err, exists) {
                if (err)
                    return done(err);
                else if (exists) {
                        req.userDetails=1;
                     return done(err, req.userDetails);
                } else {

    }



via Ankita Kashyap

No comments:

Post a Comment