GitOrigin-RevId: ca0529fe1df2ce7c5c1bc3d1d99044a54ce4ec88
This commit is contained in:
Ersun Warncke 2019-11-07 09:29:24 -04:00 committed by sharelatex
parent 7ea1a03c6b
commit 4c56fd9f5d
2 changed files with 3 additions and 5 deletions

View file

@ -3,7 +3,6 @@ const Errors = require('./Errors')
const logger = require('logger-sharelatex')
const AuthenticationController = require('../Authentication/AuthenticationController')
const SamlLogHandler = require('../SamlLog/SamlLogHandler')
const _ = require('lodash')
module.exports = ErrorController = {
notFound(req, res) {
@ -25,8 +24,7 @@ module.exports = ErrorController = {
const user = AuthenticationController.getSessionUser(req)
// log errors related to SAML flow
if (req.session.saml) {
const providerId = _.get(req.session.saml, 'universityId', '').toString()
SamlLogHandler.log(providerId, req.sessionID, {
SamlLogHandler.log(req.session.saml.universityId, req.sessionID, {
error: {
message: error && error.message,
stack: error && error.stack

View file

@ -3,12 +3,12 @@ const logger = require('logger-sharelatex')
function log(providerId, sessionId, data) {
const samlLog = new SamlLog()
samlLog.providerId = providerId
samlLog.providerId = (providerId || '').toString()
samlLog.sessionId = sessionId
samlLog.data = data
samlLog.save(err => {
if (err) {
logger.error({ err }, 'SamlLog Error')
logger.error({ err, sessionId, providerId }, 'SamlLog Error')
}
})
}