2024-10-15 11:57:37 +08:00
|
|
|
import mongoose from "mongoose";
|
2024-06-10 15:54:45 -07:00
|
|
|
|
|
|
|
|
const RecoveryTokenSchema = mongoose.Schema(
|
2024-10-17 12:07:30 +08:00
|
|
|
{
|
|
|
|
|
email: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
unique: true,
|
|
|
|
|
},
|
|
|
|
|
token: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
expiry: {
|
|
|
|
|
type: Date,
|
|
|
|
|
default: Date.now,
|
|
|
|
|
expires: 600,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
timestamps: true,
|
|
|
|
|
}
|
2024-06-10 15:54:45 -07:00
|
|
|
);
|
|
|
|
|
|
2024-10-15 11:57:37 +08:00
|
|
|
export default mongoose.model("RecoveryToken", RecoveryTokenSchema);
|