@felloh-org/lambda-wrapper 1.1.48 → 1.1.51

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.
@@ -37,6 +37,7 @@ class AuthenticationService extends _dependencyAware.default {
37
37
  this.userRoleRepository = await that.connection.getRepository(_userRole.default);
38
38
  this.organisationRepository = await that.connection.getRepository(_organisation.default);
39
39
  this.user = await di.get(_dependencies.DEFINITIONS.USER).getUser();
40
+ di.get(_dependencies.DEFINITIONS.LOGGER).info(`user.id: ${this.user.id}`);
40
41
  }
41
42
  };
42
43
  }
@@ -51,7 +52,7 @@ class AuthenticationService extends _dependencyAware.default {
51
52
  await this.initialise();
52
53
  const response = [];
53
54
 
54
- for await (const organisation of user.organisations) {
55
+ for (const organisation of user.organisations) {
55
56
  const orgs = await this.organisationRepository.findDescendants(organisation, {
56
57
  relations: ['parent']
57
58
  });
@@ -90,7 +91,7 @@ class AuthenticationService extends _dependencyAware.default {
90
91
  return roles.indexOf(role) !== -1;
91
92
  }
92
93
  /**
93
- * Check user role and organisation access
94
+ * Check a users role and organisation access
94
95
  * @param organisationID
95
96
  * @param roles
96
97
  * @returns {Promise<boolean>}
@@ -51,7 +51,7 @@ class User extends _dependencyAware.default {
51
51
  });
52
52
  }
53
53
 
54
- return this.di.getEvent().requestContext.authorizer.user;
54
+ return JSON.parse(this.di.getEvent().requestContext.authorizer.user);
55
55
  }
56
56
 
57
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.48",
3
+ "version": "1.1.51",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {