mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
pr fixes
GitOrigin-RevId: ca0529fe1df2ce7c5c1bc3d1d99044a54ce4ec88
This commit is contained in:
parent
7ea1a03c6b
commit
4c56fd9f5d
2 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue