I have a UserModel that has a base model USER and a REST datasource
"UserModel": { "dataSource": "mock", "public": true }
Data Source
"mock": { "name": "mock", "baseURL": "http://localhost:3000/", "connector": "rest" },
The UserModel
{ "name": "UserModel", "base": "User", "idInjection": true, "options": { "validateUpsert": true }, "properties": {}, "validations": [], "relations": {}, "acls": [], "methods": {} }
The problem when I call /UserModel/login with a post and a body like
{"username": "test", "password": "123"}
in the mock server I only get a call without even the password to:
/UserModels?where%5Busername%5D=test&limit=1&offset=0&skip=0
I want to handle the login through REST and a backend that receives the Username and password check for them and return 200 or 401
Finally got the issue. It was a misunderstanding. Loopback tries to log in on his own so he needs the user model so in his tier it can hash the input password and try to assert the two data. So it needs to get the user as it did.