Я новичок в feathersjs. Я создаю бэкэнд-сервер, используя его, и мне нужно добавить 2 способа локальной аутентификации, по электронной почте или по мобильному телефону. Я уже добавил новый локальный сервер к config/default.json
следующим образом
"local-mobile": {
"usernameField": "mobile",
"passwordField": "password"
},
вот мой файл authentication.js
const { AuthenticationService, JWTStrategy } = require('@feathersjs/authentication');
const { LocalStrategy } = require('@feathersjs/authentication-local');
const { expressOauth } = require('@feathersjs/authentication-oauth');
module.exports = app => {
const authentication = new AuthenticationService(app);
authentication.register('jwt', new JWTStrategy());
authentication.register('local', new LocalStrategy());
authentication.register('local-mobile', new LocalStrategy());
app.use('/authentication', authentication);
app.configure(expressOauth());
};
в src/authentication
Но когда я отправляю почтовый запрос конечной точке аутентификации, используя почтальон со следующим телом
{
"strategy":"local-mobile",
"mobile":".......",
"password":"........"
}
ответ приходит
{
"name": "NotAuthenticated",
"message": "Invalid authentication information",
"code": 401,
"className": "not-authenticated",
"errors": {}
}
любая идея?