Skip to content

Commit

Permalink
Merge pull request #581 from Soujanya2004/revert-580-mongoose-Schema
Browse files Browse the repository at this point in the history
Revert "updated Schema"
  • Loading branch information
Soujanya2004 authored Nov 21, 2024
2 parents ffdee8c + d4487e7 commit 6cf0d54
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@ const Schema = mongoose.Schema;
const passportlocalmongoose = require("passport-local-mongoose");

const userSchema = new Schema({
email: {
type: String,
required: true,
unique: true,
},
// Field for upload profile pic feature
profilePicture: {
url: { type: String, default: null }, // Full URL to the picture
filename: { type: String, default: null }, // File name for internal tracking
},
// Field for checking the admin
isAdmin: {
// Add this field
type: Boolean,
default: false, // Default is false for regular users
},
passwordresetToken: {
type: String,
default: null,
},
TokenExpires: {
type: String,
default: null,
},
passwordResetAt: Date,
passwordResetTokenExpires: Date,
email: {
type: String,
required: true
},
// Field for upload profile pic feature
profilePicture: {
purl: String, // Store the file path or URL here
pfilename: String,
},
// Field for checking the admin
isAdmin: { // Add this field
type: Boolean,
default: false // Default is false for regular users
},
passwordresetToken: {
type: String,
default: null,
},
TokenExpires: {
type: String,
default: null,
},
passwordResetAt: Date,
passwordResetTokenExpires: Date,
});

userSchema.plugin(passportlocalmongoose);
userSchema.plugin(passportlocalmongoose);
module.exports = mongoose.model("User", userSchema);

0 comments on commit 6cf0d54

Please sign in to comment.