How to use it in koa-passport middleware?

const LocalStrategy = require("passport-local").Strategy
passport.use(new LocalStrategy(async function (username, password, done) {
  // FK: username
  let user = await userStore.getUserByName(username)
  // FK: passwordhash
  if (user && validate(password, user.hash)) {
    done(null, user)
  } else {
    log.info(`auth failed for`, username)
    done(null, false)
  }
}))
When using

koa-passport middleware, are there many done callback functions in it? where is this function implemented? Is it already realized? Or do you need to do it yourself? Read several tutorials, still do not understand how to use, more messy.
reference tutorials are as follows:
https://codeshelper.com/a/11.

https://codeshelper.com/a/11.

Mar.13,2021

done is a callback function, which means to tell the caller ( passport ) that you have finished what you want to execute, and let it continue to run its logic.
is usually called back in the form of done (err,data) .

Menu