我尝试使用保存在 mongodb 中的本地用户登录我的应用程序。我的应用程序使用 feathersjs 在 Node.js 上运行。运行应用程序后,我收到如下错误:
Error: You must provide a 'header' in your authentication configuration or pass one explicitly
这是我的配置文件:
{
"host": "localhost",
"port": 3030,
"public": "../public/",
"paginate": {
"default": 10,
"max": 50
},
"authentication": {
"secret": "My secret key",
"strategies": [
"jwt",
"local"
],
"path": "/authentication",
"service": "authentication",
"jwt": {
"header": {
"type": "access"
},
"audience": "https://yourdomain.com",
"subject": "anonymous",
"issuer": "feathers",
"algorithm": "HS256",
"expiresIn": "1d"
},
"local": {
"entity": "user",
"usernameField": "email",
"passwordField": "password"
}
},
"mongodb": "mongodb://localhost:27017/mydb"
}
这有什么问题?