mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
truncate sessionId in saml logs
GitOrigin-RevId: 45c369a88323e340875ae7b9f4d26e664ccdc8d8
This commit is contained in:
parent
1c759ad413
commit
58077c4eff
1 changed files with 8 additions and 8 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue