const mongoose = require("mongoose");
const passportLocalMongoose = require("passport-local-mongoose");

const UserSchema = new mongoose.Schema(
  {
    googleId: String,
    username: String,
    email: String,
    password: String,
    profilePicture: String,
    resetPasswordToken: {
      type: String,
      default: null,
    },
    resetPasswordExpires: {
      type: Date,
      default: null,
    },
    isAdmin:{
      type:Boolean,
      default: false,
    }
  },
  {
    timestamps: true, 
  }
);

UserSchema.plugin(passportLocalMongoose);

module.exports = mongoose.model("User", UserSchema);
