mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
limit login attempts
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user