From 973e38c9cb7171271220aae502203a3128d070f7 Mon Sep 17 00:00:00 2001 From: Dinesh101041 Date: Tue, 2 Feb 2021 22:54:04 +0530 Subject: [PATCH] added a password validator pattern --- models/userModel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/models/userModel.js b/models/userModel.js index f69af70..e039b17 100644 --- a/models/userModel.js +++ b/models/userModel.js @@ -28,6 +28,7 @@ const userSchema = new mongoose.Schema({ type: String, required: [true, 'Please provied a password'], minlength: 8, + pattern: "^[A-Za-z0-9 -_@]$", select: false }, passwordConfirm: {