mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 19:41:33 +02:00
truncate sessionId in saml logs
GitOrigin-RevId: 45c369a88323e340875ae7b9f4d26e664ccdc8d8
This commit is contained in:
@@ -2,19 +2,19 @@ const { SamlLog } = require('../../models/SamlLog')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
||||
function log(providerId, sessionId, data) {
|
||||
const samlLog = new SamlLog()
|
||||
samlLog.providerId = (providerId || '').toString()
|
||||
samlLog.sessionId = sessionId
|
||||
try {
|
||||
const samlLog = new SamlLog()
|
||||
samlLog.providerId = (providerId || '').toString()
|
||||
samlLog.sessionId = (sessionId || '').toString().substr(0, 8)
|
||||
samlLog.jsonData = JSON.stringify(data)
|
||||
samlLog.save(err => {
|
||||
if (err) {
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog Error')
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog JSON.stringify Error')
|
||||
}
|
||||
samlLog.save(err => {
|
||||
if (err) {
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog Error')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const SamlLogHandler = {
|
||||
|
||||
Reference in New Issue
Block a user