Skip to content

Commit

Permalink
hotfix for eventName check and better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelmaeuer committed Apr 12, 2021
1 parent cbde517 commit cf20997
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ingest/events/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ module.exports = async (req, res) => {
const { user } = req

// check eventName
if (message?.event !== eventName) {
if (message?.event && message.event !== eventName) {
// log access attempt
logger.log({
level: 'warning',
message: 'User attempted event with mismatching names',
source,
data: {
email: req.user.email,
body: message.event,
body: req.body,
params: eventName,
},
})
Expand Down

0 comments on commit cf20997

Please sign in to comment.