@ccci/micro-server 1.0.212 → 1.0.214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -298064,6 +298064,7 @@ class RouterFactory {
|
|
|
298064
298064
|
const token = bearerToken.split(" ")[1];
|
|
298065
298065
|
let decoded = verify(token);
|
|
298066
298066
|
req.user = decoded;
|
|
298067
|
+
console.log("req.user", req.user);
|
|
298067
298068
|
} else if (!grantPublicAccess)
|
|
298068
298069
|
return res.status(401).send({ success: false, error: 1004, errorMessage: "Unauthorized. No access token found on the request." });
|
|
298069
298070
|
next();
|
|
@@ -304304,13 +304305,15 @@ class BaseController {
|
|
|
304304
304305
|
try {
|
|
304305
304306
|
await this.beforeCreate(req);
|
|
304306
304307
|
let data = req.body;
|
|
304307
|
-
|
|
304308
|
+
console.log("req.user :>> ", req.user);
|
|
304309
|
+
console.log("req.user.id :>> ", req.user.id);
|
|
304310
|
+
console.log("req.user.id :>> ", req.user._id);
|
|
304308
304311
|
if (req.user && !req.query.disableDefaultId) {
|
|
304309
|
-
data.createdById = req.user.id ?? req.user._id;
|
|
304312
|
+
data.createdById = req.user.id ?? req.user._id ?? req.user.user.id ?? req.user.user._id;
|
|
304310
304313
|
}
|
|
304311
|
-
|
|
304314
|
+
console.log("BaseController.create :>> ", data);
|
|
304312
304315
|
let response4 = await this._model?.create(data);
|
|
304313
|
-
|
|
304316
|
+
console.log("BaseController.create :>> ", response4);
|
|
304314
304317
|
await this.afterCreate(req, response4);
|
|
304315
304318
|
return ResponseHelper(response4);
|
|
304316
304319
|
} catch (error) {
|