budibase/packages/auth/src/middleware/auditLog.js

11 lines
208 B
JavaScript
Raw Normal View History

2021-05-28 11:09:32 +02:00
module.exports = async (ctx, next) => {
ctx.log.info({
userId: ctx.user && ctx.user._id,
ip: ctx.ip,
url: ctx.originalUrl,
origin: ctx.origin,
method: ctx.method,
})
return next()
}