mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
27 lines
696 B
JavaScript
27 lines
696 B
JavaScript
|
const Settings = require('settings-sharelatex')
|
||
|
const mongoose = require('mongoose')
|
||
|
const { Schema } = mongoose
|
||
|
|
||
|
const SamlLogSchema = new Schema(
|
||
|
{
|
||
|
createdAt: { type: Date, default: () => new Date() },
|
||
|
data: { type: Object, default: {} },
|
||
|
providerId: { type: String, default: '' },
|
||
|
sessionId: { type: String, default: '' }
|
||
|
},
|
||
|
{
|
||
|
collection: 'samlLogs'
|
||
|
}
|
||
|
)
|
||
|
|
||
|
const conn = mongoose.createConnection(Settings.mongo.url, {
|
||
|
server: { poolSize: Settings.mongo.poolSize || 10 },
|
||
|
config: { autoIndex: false }
|
||
|
})
|
||
|
|
||
|
const SamlLog = conn.model('SamlLog', SamlLogSchema)
|
||
|
|
||
|
mongoose.model('SamlLog', SamlLogSchema)
|
||
|
exports.SamlLog = SamlLog
|
||
|
exports.SamlLogSchema = SamlLogSchema
|