我正在尝试使用@feathersjs/authentication-local 对用户进行身份验证,虽然我提供了正确的用户名和密码,但我得到了以下响应
{
"name": "BadRequest",
"message": "Missing credentials",
"code": 400,
"className": "bad-request",
"data": {
"message": "Missing credentials"
},
"errors": {}
}
user
实体的DB 属性是username
& password
。我的配置如下
const settings = {
secret: 'super&secret',
usernameField: 'username',
passwordField: 'password',
entityUsernameField: 'username',
entityPasswordField: 'password'
};
app.configure(authentication(settings))
.configure(local());
app.service('authentication').hooks({
before: {
create: [authentication.hooks.authenticate(['local', 'jwt'])],
remove: [],
}
});
我已经添加"strategy": "local"
了请求正文。我错过了什么?请帮忙。