Node.js 认证策略&x27;jwt&x27;没有注册 复制步骤
我将需要身份验证的featherjs示例项目部署到Google Appengine,并收到以下错误消息:Node.js 认证策略&x27;jwt&x27;没有注册 复制步骤,node.js,google-app-engine,feathersjs,google-appengine-node,Node.js,Google App Engine,Feathersjs,Google Appengine Node,我将需要身份验证的featherjs示例项目部署到Google Appengine,并收到以下错误消息: { "name": "BadRequest", "message": "Authentication strategy 'jwt' is not registered.", "code": 400, "className": "bad-request", "errors": {} } 我的应用程序引擎日志显示以下内容: 错误:BadRequest:未
{
"name": "BadRequest",
"message": "Authentication strategy 'jwt' is not registered.",
"code": 400,
"className": "bad-request",
"errors": {}
}
我的应用程序引擎日志显示以下内容:
错误:BadRequest:未注册身份验证策略“jwt”。
在新的请求中(/srv/node_modules/@feathersjs/errors/lib/index.js:86:17)
反对。(/srv/node_modules/@feathersjs/authentication/lib/hooks/authenticate.js:41:29)
位于promise.then.hookObject(/srv/node_modules/@feathersjs/commons/lib/hooks.js:167:73)
在<匿名>
是否有强制注册JWT的方法?这在我的featherjs开发环境中工作得很好,所以正常环境的设置没有任何问题,只是想知道是否有人对如何运行它有任何建议。似乎解决了我的问题
app.service('authentication').hooks({
before: {
create: [
authentication.hooks.authenticate(app.get('auth').strategies)
],
remove: authentication.hooks.authenticate('jwt')
}
});
似乎解决了我的问题
app.service('authentication').hooks({
before: {
create: [
authentication.hooks.authenticate(app.get('auth').strategies)
],
remove: authentication.hooks.authenticate('jwt')
}
});