mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
22 lines
401 B
JavaScript
22 lines
401 B
JavaScript
|
|
const mongoose = require("mongoose");
|
||
|
|
const Schema = mongoose.Schema;
|
||
|
|
|
||
|
|
const tokenSchema = new Schema({
|
||
|
|
userId: {
|
||
|
|
type: Schema.Types.ObjectId,
|
||
|
|
required: true,
|
||
|
|
ref: "user",
|
||
|
|
},
|
||
|
|
token: {
|
||
|
|
type: String,
|
||
|
|
required: true,
|
||
|
|
},
|
||
|
|
createdAt: {
|
||
|
|
type: Date,
|
||
|
|
required: true,
|
||
|
|
default: Date.now,
|
||
|
|
expires: 900,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
module.exports = mongoose.model("Token", tokenSchema);
|