+ signup and + verify
All checks were successful
gitea/MERN_STACK_TEMPLATE/pipeline/head This commit looks good
All checks were successful
gitea/MERN_STACK_TEMPLATE/pipeline/head This commit looks good
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const userSchema = new mongoose.Schema(
|
||||
{
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
lastLogin: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
},
|
||||
isVerified: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
resetPasswordToken: String,
|
||||
resetPasswordExpiresAt: Date,
|
||||
verificationToken: String,
|
||||
verificationTokenExpiresAt: Date,
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
export const User = mongoose.model("User", userSchema);
|
Reference in New Issue
Block a user