From cf0421c94b8ca14e819bad45e7db6875b92d547b Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 18 Jul 2024 15:49:21 +0530 Subject: added and setup dashboard login auth and many more --- server/models/User.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'server/models') 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); -- cgit v1.2.3-59-g8ed1b