@cocreate/users 1.36.4 → 1.36.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [1.36.6](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.5...v1.36.6) (2024-02-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * forgot pasword dispatch success event ([9ed6ddf](https://github.com/CoCreate-app/CoCreate-users/commit/9ed6ddf6402eba3d793174ddfd5b01037f2f97ab))
7
+ * handling of uid ([5690f38](https://github.com/CoCreate-app/CoCreate-users/commit/5690f38fef046a0e24b21aea851f024861d631e0))
8
+
9
+ ## [1.36.5](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.4...v1.36.5) (2024-02-16)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * temp updateDB solution ([40d3db1](https://github.com/CoCreate-app/CoCreate-users/commit/40d3db15c02655bb0908375ec0f32436d793b36c))
15
+
1
16
  ## [1.36.4](https://github.com/CoCreate-app/CoCreate-users/compare/v1.36.3...v1.36.4) (2024-02-16)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.36.4",
3
+ "version": "1.36.6",
4
4
  "description": "A simple users component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "users",
package/src/client.js CHANGED
@@ -351,7 +351,8 @@ const CoCreateUser = {
351
351
  }
352
352
 
353
353
  Crud.socket.send(request).then((response) => {
354
- console.log('forgot password', response)
354
+ if (response.success)
355
+ document.dispatchEvent(new CustomEvent('forgotPassword'));
355
356
  render({
356
357
  selector: "[template*='forgotPassword']",
357
358
  data: [{
package/src/server.js CHANGED
@@ -159,14 +159,17 @@ class CoCreateUser {
159
159
  try {
160
160
  const inviteId = this.crud.ObjectId().toString()
161
161
  let uid = data.uid
162
- data.uid = data.uid + '-inv'
162
+ delete data.uid
163
163
 
164
164
  data.method = 'object.update'
165
165
  data.array = "users"
166
166
  data.object = { _id: data.user_id, '$push.invitations': inviteId, '$addToSet.members': data.email }
167
+
168
+ // TODO: upodateDB is a temp solution to by pass crud.sync clientId as all crud methods are ignored fro same clientid except for read
167
169
  data.updateDB = true
170
+
168
171
  data = await this.crud.send(data)
169
- data.database = data.organization_id
172
+
170
173
 
171
174
  let invitee = await this.crud.send({
172
175
  method: 'object.read',
@@ -263,11 +266,14 @@ class CoCreateUser {
263
266
  data.$filter = {
264
267
  query: {
265
268
  invitations: { $in: [data.token] },
266
- members: { $in: [data.email] },
267
- limit: 2
268
- }
269
+ members: { $in: [data.email] }
270
+ },
271
+ limit: 2
269
272
  }
270
273
 
274
+ // TODO: upodateDB is a temp solution to by pass crud.sync clientId as all crud methods are ignored fro same clientid except for read
275
+ data.updateDB = true
276
+
271
277
  data = await this.crud.send(data)
272
278
 
273
279
  let response = {