@autofleet/zehut 3.1.0-beta.1 → 3.1.0-beta.2
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/lib/user/index.js +2 -2
- package/package.json +1 -1
package/lib/user/index.js
CHANGED
|
@@ -42,7 +42,7 @@ const middleware = (options = {}) => async (req, res, next) => {
|
|
|
42
42
|
}
|
|
43
43
|
const { eagerLoadUserPermissions, eagerLoadUserPermissionsLegacy, customPermissionLoader, } = options;
|
|
44
44
|
const userId = req.headers['x-af-user-id'];
|
|
45
|
-
const contextIds = req.headers?.[
|
|
45
|
+
const contextIds = req.headers?.[ApiUser_1.CONTEXTS_IDS_HEADER]?.split(',');
|
|
46
46
|
const trace = (0, tracer_1.newTrace)('userPayload');
|
|
47
47
|
if (!userId) {
|
|
48
48
|
return next();
|
|
@@ -109,7 +109,7 @@ const middlewareWithDecode = (options = {}) => async (req, res, next) => {
|
|
|
109
109
|
if (userId) {
|
|
110
110
|
req.headers['X-AF-USER-ID'] = userId;
|
|
111
111
|
}
|
|
112
|
-
const contextIds = req.headers?.[
|
|
112
|
+
const contextIds = req.headers?.[ApiUser_1.CONTEXTS_IDS_HEADER]?.split(',');
|
|
113
113
|
const userObject = new ApiUser_1.default(userId, decoded?.user?.accountType, undefined, contextIds);
|
|
114
114
|
if (eagerLoadUserPermissions) {
|
|
115
115
|
await userObject.getUserPermissions();
|