diff options
author | Mateja <mail@matejamaric.com> | 2021-07-10 22:57:13 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-07-10 22:57:13 +0200 |
commit | 54677c68f50b7c105a1f6cc5e9593877781fc8d6 (patch) | |
tree | 8998a76fdd76ca1170dc89cbf70423aeaf0efb0c /server/models | |
parent | fd0fafa68d638b729a506ba668165e29eea71a49 (diff) | |
download | mevn-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.js | 1 |
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: { |