fixup AuthenticationController from missing module after merge

This commit is contained in:
Henry Oswald 2017-03-27 09:42:38 +01:00
parent 67943a8906
commit f27dfa54f1

View file

@ -1,15 +1,15 @@
AnalyticsManager = require "./AnalyticsManager" AnalyticsManager = require "./AnalyticsManager"
Errors = require "../Errors/Errors" Errors = require "../Errors/Errors"
AuthenticationController = require("../Authentication/AuthenticationController")
module.exports = AnalyticsController = module.exports = AnalyticsController =
recordEvent: (req, res, next) -> recordEvent: (req, res, next) ->
user_id = AuthenticationController.getLoggedInUserId(req) or req.sessionID user_id = AuthenticationController.getLoggedInUserId(req) or req.sessionID
AnalyticsManager.recordEvent user_id, req.params.event, req.body, (error) -> AnalyticsManager.recordEvent user_id, req.params.event, req.body, (error) ->
if error?
if error instanceof Errors.ServiceNotConfiguredError if error instanceof Errors.ServiceNotConfiguredError
# ignore, no-op # ignore, no-op
return res.send(204) return res.send(204)
else else if error?
return next(error) return next(error)
res.send 204 else
return res.send 204