limit login attempts

This commit is contained in:
2018-06-28 19:09:51 +03:00
parent 496601d687
commit aa6b0fb7af

View File

@@ -21,7 +21,10 @@ const UserSchema = Schema({
todos: [{ type: Schema.Types.ObjectId, ref: 'Todo' }], todos: [{ type: Schema.Types.ObjectId, ref: 'Todo' }],
}); });
UserSchema.plugin(passportLocalMongoose); UserSchema.plugin(passportLocalMongoose, {
limitAttempts: true,
maxAttempts: 20,
});
UserSchema.plugin(uniqueValidator); UserSchema.plugin(uniqueValidator);
UserSchema.pre('remove', async function() { UserSchema.pre('remove', async function() {