From 54677c68f50b7c105a1f6cc5e9593877781fc8d6 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 10 Jul 2021 22:57:13 +0200 Subject: Implemented JWT authentication using Passport.js --- server/models/User.js | 1 + 1 file changed, 1 insertion(+) (limited to 'server/models') diff --git a/server/models/User.js b/server/models/User.js index 401fb32..294c016 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -22,6 +22,7 @@ const UserSchema = new mongoose.Schema({ }, email: { type: String, + unique: [true, "Account with given email already exists!"], required: [true, "You need to provide an email."], maxLength: [100, "You can't have a email longer than 100 characters."], validate: { -- cgit v1.2.3