mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook * refactor: reformat files * build: put full eslintrc back with all rules
22 lines
398 B
JavaScript
22 lines
398 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);
|