NodeJS jwtStrategy需要一个函数来从MERN中的请求错误中检索jwt

时间:2018-07-03 11:22:09

标签: mern

C:\Users\Nalin\Desktop\devconnector\config\passport.js:2
jwtOptions.jwtFromRequest = ExtractJwt.fromAuthHeaderAsBearerToken();
^

ReferenceError: jwtOptions is not defined
    at Object.<anonymous> (C:\Users\Nalin\Desktop\devconnector\config\passport.js:2:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (C:\Users\Nalin\Desktop\devconnector\server.js:29:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
[nodemon] app crashed - waiting for file changes before starting...

0 个答案:

没有答案