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.