【发布时间】:2019-07-21 09:50:49
【问题描述】:
我有 FeathersJS 作为 SocketIo 的 API Rest 服务器。对于身份验证,我使用 Firebase 并从客户端发送 fbToken,在服务器上检查并进行相应的身份验证。这是建立在 JWT 模型上的。
一切正常,除非我重新启动服务器。虽然我确实抓住了socket.on("reconnect_attempt", ()=>{... authentication function...} 并且它有效,但在重新验证之前我仍然收到错误:
error: NotAuthenticated: Strategy jwt is not permitted
at new NotAuthenticated (...my-path...\back-end\node_modules\@feathersjs\errors\lib\index.js:93:17)
at Object.<anonymous> (...my-path...\back-end\node_modules\@feathersjs\authentication\lib\hooks\authenticate.js:31:29)
at Object.<anonymous> (...my-path...\kludi\back-end\node_modules\feathers-hooks-common\lib\common\iff-else.js:17:63)
at ...my-path...\back-end\node_modules\feathers-hooks-common\node_modules\@feathersjs\commons\lib\hooks.js:164:73
at processTicksAndRejections (internal/process/task_queues.js:89:5)
问题:
为什么会出现错误?确实 JWT 没有注册,我将方法命名为“firebaseAuth”,但是谁在使用 JWT 策略调用 auth 函数?在代码中找不到。
我应该忽略它还是解决它?即使没有修复错误,我也会感到不舒服。
【问题讨论】:
标签: error-handling socket.io jwt feathersjs