@cocreate/users 1.39.0 → 1.39.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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/client.js +5 -5
- package/src/server.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.39.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.1...v1.39.2) (2026-04-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* await user creation and set userKey if provided ([5048619](https://github.com/CoCreate-app/CoCreate-users/commit/50486192da29d2f68a05bbab7c6c0eae5825e081))
|
|
7
|
+
|
|
8
|
+
## [1.39.1](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.0...v1.39.1) (2026-04-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* property access for user object in client.js ([94369a5](https://github.com/CoCreate-app/CoCreate-users/commit/94369a56dc78ee5cc3aaa9449e1a88c62ddf2c8d))
|
|
14
|
+
|
|
1
15
|
# [1.39.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.38.6...v1.39.0) (2026-04-04)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
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]
|
|
38
|
+
_id: user.object._id || user.object[0]?._id,
|
|
39
39
|
type: "user",
|
|
40
|
-
key: user.object[0]
|
|
41
|
-
roles: user.object
|
|
42
|
-
email: user.object[0]
|
|
43
|
-
password: user.object
|
|
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
|
};
|
package/src/server.js
CHANGED
|
@@ -41,7 +41,10 @@ class CoCreateUser {
|
|
|
41
41
|
if (data.user) {
|
|
42
42
|
data.user.method = "object.create";
|
|
43
43
|
data.user.host = data.host;
|
|
44
|
-
await this.crud.send(data.user);
|
|
44
|
+
let createdUser = await this.crud.send(data.user);
|
|
45
|
+
if (data.userKey && createdUser.object[0] && createdUser.object[0]._id) {
|
|
46
|
+
data.userKey.object.key = createdUser.object[0]._id;
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
if (data.userKey) {
|