@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 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?.['x-af-contexts-ids']?.split(',');
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?.['x-af-contexts-ids']?.split(',');
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/zehut",
3
- "version": "3.1.0-beta.1",
3
+ "version": "3.1.0-beta.2",
4
4
  "description": "manage user's identity",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",