diff --git a/services/loopback/common/models/client-log.json b/services/loopback/common/models/client-log.json index fd5a06329..947036d79 100644 --- a/services/loopback/common/models/client-log.json +++ b/services/loopback/common/models/client-log.json @@ -17,8 +17,7 @@ "required": true }, "userFk": { - "type": "Number", - "required": true + "type": "Number" }, "action": { "type": "String", diff --git a/services/loopback/common/models/loggable.js b/services/loopback/common/models/loggable.js index d01a3062b..902dc1291 100644 --- a/services/loopback/common/models/loggable.js +++ b/services/loopback/common/models/loggable.js @@ -127,7 +127,7 @@ module.exports = function(Self) { let userFk; - if (!loopBackContext) userFk = process.env.NODE_ENV ? 1765 : 111; + if (!loopBackContext) userFk = null; else userFk = loopBackContext.active.accessToken.userId; let action = setActionType(ctx);