discord-multipurpose-bot/models/VerificationCode.js

11 lines
407 B
JavaScript
Raw Permalink Normal View History

2024-08-31 02:34:09 +01:00
const mongoose = require("mongoose");
const VerificationCodeSchema = new mongoose.Schema({
userId: { type: String, required: true },
email: { type: String, required: true },
code: { type: String, required: true },
createdAt: { type: Date, expires: "10m", default: Date.now }, // Code expires in 10 minutes
});
module.exports = mongoose.model("VerificationCode", VerificationCodeSchema);