aboutsummaryrefslogtreecommitdiffstats
path: root/server/models
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 15:49:21 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 15:49:21 +0530
commitcf0421c94b8ca14e819bad45e7db6875b92d547b (patch)
tree8deb4de15449bc2cf24c88950490ce60b5f6aaa8 /server/models
parentbe93c42fc010e7309e9e10d0431418ae5e7dbb93 (diff)
downloadadmin-panel-cf0421c94b8ca14e819bad45e7db6875b92d547b.tar.gz
admin-panel-cf0421c94b8ca14e819bad45e7db6875b92d547b.tar.bz2
admin-panel-cf0421c94b8ca14e819bad45e7db6875b92d547b.zip
added and setup dashboard login auth and many more
Diffstat (limited to 'server/models')
-rw-r--r--server/models/User.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/server/models/User.js b/server/models/User.js
index 6773c64..968673e 100644
--- a/server/models/User.js
+++ b/server/models/User.js
@@ -1,7 +1,15 @@
const mongoose = require('mongoose');
+
const UserSchema = new mongoose.Schema({
- username: { type: String, reauired: true, unique: true },
- password: { type: String, required: true },
- role: { type: String, default: 'admin' },
+ email: {
+ type: String,
+ required: true,
+ unique: true,
+ },
+ password: {
+ type: String,
+ required: true,
+ },
});
+
module.exports = mongoose.model('User', UserSchema);