mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
This commit is contained in:
parent
92eee52c52
commit
e56d90e45a
3 changed files with 4 additions and 6 deletions
|
|
@ -79,7 +79,7 @@ const userSchema = mongoose.Schema(
|
|||
|
||||
//Remove refreshToken from the response
|
||||
userSchema.set('toJSON', {
|
||||
transform: function (doc, ret, options) {
|
||||
transform: function (_doc, ret,) {
|
||||
delete ret.refreshToken;
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ module.exports.validateUser = (user) => {
|
|||
password: Joi.string().min(8).max(60).allow('').allow(null)
|
||||
};
|
||||
|
||||
return Joi.validate(user, schema);
|
||||
return schema.validate(user);
|
||||
};
|
||||
|
||||
const User = mongoose.model('User', userSchema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue