Tag: bookhelf.js knex.js

诺言创build,但不是从返回。 Knex / Bookshelf

每当我点击需要validation的路由时,我在控制台中都会收到警告消息。 (node:940)警告:在xxxxxx \ app \ config \ passport.js:15:19中的处理程序中创build了一个承诺,但未从其返回,请参阅http://bluebirdjs.com/docs/warning-explanations。 html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it at .fetch(xxxxxx \ node_modules \ bluebird \ js \ release \ method.js:13:13 ) 我configuration了这样的护照: const JwtStrategy = require('passport-jwt').Strategy; const ExtractJwt = require('passport-jwt').ExtractJwt; const secret = process.env.SECRET; var opts = {} function passportConfig(db, passport) { opts.jwtFromRequest = ExtractJwt.fromAuthHeader(); opts.secretOrKey = secret; passport.use(new JwtStrategy(opts, payloadCallback.bind(null, db))); } function […]