in the passport [configure authentication] documentation, it has a rather scary-looking function that uses the mysterious function \"done.\'
passport.use(new
next()
will get the control flow to the next middleware, if there is.
In Passport.js,
Calling done()
will make the flow jump back into passport.authenticate()
. It's passed the error, user and additional info object (if defined).
In other cases, done()
will take the control flow to the next function after the function it was used in.