Passport: promise was created in a handler... but was not returned from it

Created on 19 Mar 2017  路  6Comments  路  Source: jaredhanson/passport

Environment

$ node --version
v7.5.0

Passport version: 0.3.2
Passport-strategy: 1.0.0
Bluebird: 3.5.0

I'm seeing this warning every time I try and authenticate using passport:

(node:1072) Warning: a promise was created in a handler at ...node_modules/passport/lib/authenticator.js:339:7 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.attempt.Promise.try (...node_modules/bluebird/js/release/method.js:29:9)

Is this expected? Is something I'm using incompatible with something else?

Most helpful comment

Same here.
This should be fixed.

All 6 comments

Same here.
This should be fixed.

I am getting this warning in this context:

passport.use(new LocalStrategy(
  {
    usernameField: 'email',
    passwordField: 'password'
  },
  function (username, password, done) {

    // Search for the user
    knex('users').first()
      .where({ 'email': username })
      .then(user => {
        // If no user is found
        if (!user) {
          console.log(`[Authentication] User not found: ${username}`)
          return done(null, false, { message: 'Incorrect credentials' }) <--- Warning happens here
        }
    ....
  })
))

Is this going to fixed sometime soon?

Seems like this project is a zombie, so I'll close this.

Is passport not being maintained anymore?

I have the same issue, does anyone find a solution yet?

I am getting this warning specifically for a http delete request

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PymZoR picture PymZoR  路  3Comments

angel1st picture angel1st  路  5Comments

callumacrae picture callumacrae  路  5Comments

ginovski picture ginovski  路  6Comments

andrewbanchich picture andrewbanchich  路  4Comments