文件名称:koa-passport实现本地验证的方法示例
文件大小:28KB
文件格式:PDF
更新时间:2024-01-10 02:36:54
AS koa OR
安装 yarn add koa-passport passport-local 先看下passport.js登录策略,判断用户和密码 const passport = require('koa-passport') const LocalStrategy = require('passport-local').Strategy const User = require('../../dbs/models/users') passport.use(new LocalStrategy((username, password, done) => { User.findOne({username