Step to reproduce:
- Create a sample app
slc loopback
- Expose
User model with public: true
- Create a new user:
POST /Users { "password": "foo", "email": "foo@bar.com" }
- Try to authenticate with password
foo
- It success
- Update the user with new password:
PUT /Users/1 { "password": "bar" }
- Try to authenticate with password
bar
- It fails
Diagnostic:
It seems that the setter results (see UserModel.setter.password) is not used as "data" for the connector, see: DataAccessObject.prototype.updateAttributes . So I think that setter results is never saved in db.
It is really critic because it causes the User model not usable.
Versions:
├─┬ loopback@2.26.2
│ ├── loopback-connector-remote@1.0.3
│ ├── loopback-phase@1.3.0
│ └── strong-remoting@2.25.0
├── loopback-boot@2.16.0
├── loopback-component-explorer@2.3.0
├── loopback-connector-mysql@2.2.0
└── loopback-datasource-juggler@2.45.0
Step to reproduce:
slc loopbackUsermodel withpublic: truePOST /Users{ "password": "foo", "email": "foo@bar.com" }fooPUT /Users/1{ "password": "bar" }barDiagnostic:
It seems that the setter results (see UserModel.setter.password) is not used as "data" for the connector, see: DataAccessObject.prototype.updateAttributes . So I think that setter results is never saved in db.
It is really critic because it causes the User model not usable.
Versions: