Open lagonnebula opened 9 years ago
I have a model for User with a password.
So i added a validations method like :
password : orm.enforce.security.password("lu4", "So easy password"),
to check if the pass have minimum security ( simple example ).
And i added a beforeCreate hook to put the password encrypted in the database:
beforeCreate: function(next){ var shasum = crypto.createHash("sha1"); shasum.update(this.password); this.password = shasum.digest("hex"); return next(); }
But here i have an erro telling me that my password is too easy because i don'tt have any upercase.
How can i procede ?
afterValidate, surely? I think you'll have issues with updating the password, unless we get https://github.com/dresende/node-orm2/issues/570
I have a model for User with a password.
So i added a validations method like :
to check if the pass have minimum security ( simple example ).
And i added a beforeCreate hook to put the password encrypted in the database:
But here i have an erro telling me that my password is too easy because i don'tt have any upercase.
How can i procede ?