You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
User.validatePassword throws uncaught exception in User.create #1364
I tried with loopback 2.18.0 => error is still there.
looking at the source nothing changed to User.hashPassword and User.validatePassword.
function User.validatePassword can throw exception , this exception is not handled in UserModel.setter.password
I'm having this issue as well. I overrode validatePassword in my own User model subclass and used the default implementation as a reference. Now my instance crashes whenever there's an invalid password. Should I just return false instead of throwing an error?
But still validatePassword exceptions are not caught in User.create function it self and returned in cb.
For example if the create functions are wrapped in a dataSource.autoupdate function, the application crashes.
see updated loopback-sandbox example. cleas/loopback-sandbox@fd0fd33
Activity
superkhau commentedon Jul 7, 2015
I tried running your example. I get:
Seems like this is fixed in the latest LoopBack. Can you confirm so I close this?
cleas commentedon Jul 7, 2015
I tried with loopback 2.18.0 => error is still there.
looking at the source nothing changed to User.hashPassword and User.validatePassword.
function User.validatePassword can throw exception , this exception is not handled in UserModel.setter.password
rawrmaan commentedon Jul 9, 2015
I'm having this issue as well. I overrode validatePassword in my own User model subclass and used the default implementation as a reference. Now my instance crashes whenever there's an invalid password. Should I just return false instead of throwing an error?
jlvdh commentedon Sep 1, 2015
I also encountered this, and used the following as a quickfix in user.js
superkhau commentedon Sep 1, 2015
@cleas Are you still running into issues? Seems to be fixed by #941 now as I can't reproduce the error in your
loopback-sandboxfor anymore.jlvdh commentedon Sep 2, 2015
I'm still experiencing the error on Loopback 2.21.0 with the following request:
cleas commentedon Sep 2, 2015
The error in the
loopback-sandbox exampleis now catched due to the changes in commit:loopbackio/loopback-datasource-juggler@21c0067
"Report deferred exceptions via callback"
But still validatePassword exceptions are not caught in User.create function it self and returned in cb.
For example if the create functions are wrapped in a dataSource.autoupdate function, the application crashes.
see updated
loopback-sandboxexample. cleas/loopback-sandbox@fd0fd3323 remaining items
dhmlau commentedon Jul 20, 2017
UPDATE: Nevermind, the problem still exists in updateAttribute.
I'm not sure if this is still an issue. Using
loopback@2.38.24, if i set the password to empty string, the error code isINVALID_PASSWORD.Here is what I've tried:
boot/test.js:
Output:
loay commentedon Jul 21, 2017
Issue is fixed for all Loopback 2.x.x versions.