@cocreate/users 1.39.0 → 1.39.1

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,10 @@
1
+ ## [1.39.1](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.0...v1.39.1) (2026-04-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * property access for user object in client.js ([94369a5](https://github.com/CoCreate-app/CoCreate-users/commit/94369a56dc78ee5cc3aaa9449e1a88c62ddf2c8d))
7
+
1
8
  # [1.39.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.38.6...v1.39.0) (2026-04-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.39.0",
3
+ "version": "1.39.1",
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
@@ -35,12 +35,12 @@ const CoCreateUser = {
35
35
  method: "object.create",
36
36
  array: "keys",
37
37
  object: {
38
- _id: user.object[0]._id,
38
+ _id: user.object._id || user.object[0]?._id,
39
39
  type: "user",
40
- key: user.object[0]._id,
41
- roles: user.object[0].roles || [user.object[0]["roles[]"]],
42
- email: user.object[0].email,
43
- password: user.object[0].password || window.btoa("0000"),
40
+ key: user.object._id || user.object[0]?._id,
41
+ roles: user.object.roles || [user.object["roles[]"]] || user.object[0]?.roles,
42
+ email: user.object.email || user.object[0]?.email,
43
+ password: user.object.password || window.btoa("0000"),
44
44
  array: user.array
45
45
  }
46
46
  };