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 }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
Password is being stored in clear text if length is 6, just an equal sign is required here, or make sure min length for password is 7
/**
* Hook a pre save method to hash the password
*/
UserSchema.pre('save', function (next) {
if (this.password && this.isModified('password') && this.password.length >6) {
this.salt = crypto.randomBytes(16).toString('base64');
this.password = this.hashPassword(this.password);
}
next();
});
The text was updated successfully, but these errors were encountered:
Password is being stored in clear text if length is 6, just an equal sign is required here, or make sure min length for password is 7
The text was updated successfully, but these errors were encountered: