From 72bc53b6a4b58741d21c99a7906c6add20fe8cc1 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Wed, 14 Nov 2018 18:15:53 +0100 Subject: [PATCH] User model --- app/models/user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/user.js b/app/models/user.js index e0bbbe5..4f8b98b 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -12,7 +12,9 @@ const UserSchema = new Schema({ username: { type: String, lowercase: true, unique: true, required: [true, "can't be blank"], match: [/^[a-zA-Z0-9]+$/, 'is invalid'], index: true, }, - password: String, + password: { + type: String, required: [true, "can't be blank"], + }, }, { timestamps: true }); module.exports = UserSchema;