aboutsummaryrefslogtreecommitdiff
path: root/server/models
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-10 22:57:13 +0200
committerMateja <mail@matejamaric.com>2021-07-10 22:57:13 +0200
commit54677c68f50b7c105a1f6cc5e9593877781fc8d6 (patch)
tree8998a76fdd76ca1170dc89cbf70423aeaf0efb0c /server/models
parentfd0fafa68d638b729a506ba668165e29eea71a49 (diff)
downloadmevn-ecommerce-54677c68f50b7c105a1f6cc5e9593877781fc8d6.tar.gz
mevn-ecommerce-54677c68f50b7c105a1f6cc5e9593877781fc8d6.zip
Implemented JWT authentication using Passport.js
Diffstat (limited to 'server/models')
-rw-r--r--server/models/User.js1
1 files changed, 1 insertions, 0 deletions
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: {