zyket 1.2.17 → 1.2.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyket",
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -64,6 +64,10 @@ module.exports = class AuthService extends Service {
64
64
  return [];
65
65
  }
66
66
 
67
+ get organizationEnabled() {
68
+ return true;
69
+ }
70
+
67
71
  get socialProviders() {
68
72
  return {}
69
73
  }
@@ -107,22 +111,24 @@ module.exports = class AuthService extends Service {
107
111
  plugins: [
108
112
  admin(),
109
113
  bearer(),
110
- organization({
111
- schema: {
112
- organization: {
113
- additionalFields: this.organizationAdditionalFields
114
+ ...(this.organizationEnabled ? [
115
+ organization({
116
+ schema: {
117
+ organization: {
118
+ additionalFields: this.organizationAdditionalFields
119
+ },
120
+ member: {
121
+ additionalFields: this.memberAdditionalFields
122
+ }
114
123
  },
115
- member: {
116
- additionalFields: this.memberAdditionalFields
124
+ allowUserToCreateOrganization: async (user) => {
125
+ return await this.allowUserToCreateOrganization(user);
126
+ },
127
+ sendInvitationEmail: async (data) => {
128
+ return await this.sendInvitationEmail(data);
117
129
  }
118
- },
119
- allowUserToCreateOrganization: async (user) => {
120
- return await this.allowUserToCreateOrganization(user);
121
- },
122
- sendInvitationEmail: async (data) => {
123
- return await this.sendInvitationEmail(data);
124
- }
125
- }),
130
+ })
131
+ ] : []),
126
132
  ...this.plugins,
127
133
  ],
128
134
  socialProviders: this.socialProviders,