@cocreate/users 1.21.0 → 1.21.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 +15 -0
- package/CoCreate.config.js +1 -1
- package/package.json +1 -1
- package/src/client.js +7 -7
- package/src/server.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.21.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.21.1...v1.21.2) (2023-05-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* renamed signInRequest to signIn ([d6aa96b](https://github.com/CoCreate-app/CoCreate-users/commit/d6aa96b3ea705e974c8b20e38fdf3f6d478d5a4a))
|
|
7
|
+
|
|
8
|
+
## [1.21.1](https://github.com/CoCreate-app/CoCreate-users/compare/v1.21.0...v1.21.1) (2023-05-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* apikey renamed to key ([392ec35](https://github.com/CoCreate-app/CoCreate-users/commit/392ec35a1d5b0234a30cd5342ea6b6dfd0d59b05))
|
|
14
|
+
* apikey renamed to key ([f195cc7](https://github.com/CoCreate-app/CoCreate-users/commit/f195cc726e448b45e3e94ec8ee15af105840c9ba))
|
|
15
|
+
|
|
1
16
|
# [1.21.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.20.0...v1.21.0) (2023-05-10)
|
|
2
17
|
|
|
3
18
|
|
package/CoCreate.config.js
CHANGED
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -19,7 +19,7 @@ const CoCreateUser = {
|
|
|
19
19
|
crud.listen('updateUserStatus', (data) => self.updateUserStatus(data));
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
signIn: function(btn) {
|
|
23
23
|
let form = btn.closest('form');
|
|
24
24
|
let collection = form.getAttribute('collection');
|
|
25
25
|
let query = [];
|
|
@@ -45,11 +45,11 @@ const CoCreateUser = {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const socket = crud.socket.getSockets()
|
|
48
|
-
if (!socket[0] || !socket[0].connected || window && !window.navigator.onLine || crud.socket.
|
|
48
|
+
if (!socket[0] || !socket[0].connected || window && !window.navigator.onLine || crud.socket.serverOrganization == false) {
|
|
49
49
|
crud.updateDocument(request).then((response) => {
|
|
50
50
|
response['success'] = false
|
|
51
51
|
response['status'] = "signIn failed"
|
|
52
|
-
if (response.document) {
|
|
52
|
+
if (response.document && response.document[0]) {
|
|
53
53
|
response['success'] = true
|
|
54
54
|
response['status'] = "success"
|
|
55
55
|
this.signInResponse(response)
|
|
@@ -60,7 +60,7 @@ const CoCreateUser = {
|
|
|
60
60
|
} else {
|
|
61
61
|
request.broadcastBrowser = false
|
|
62
62
|
crud.socket.send('signIn', request).then((response) => {
|
|
63
|
-
this.signInResponse(
|
|
63
|
+
this.signInResponse(response)
|
|
64
64
|
})
|
|
65
65
|
}
|
|
66
66
|
},
|
|
@@ -70,7 +70,7 @@ const CoCreateUser = {
|
|
|
70
70
|
|
|
71
71
|
if (success) {
|
|
72
72
|
localStorage.setItem('organization_id', crud.socket.config.organization_id);
|
|
73
|
-
localStorage.setItem("
|
|
73
|
+
localStorage.setItem("key", crud.socket.config.key);
|
|
74
74
|
localStorage.setItem("host", crud.socket.config.host);
|
|
75
75
|
localStorage.setItem('user_id', data.document[0]['_id']);
|
|
76
76
|
localStorage.setItem("token", token);
|
|
@@ -230,7 +230,7 @@ const CoCreateUser = {
|
|
|
230
230
|
_id: user_id
|
|
231
231
|
},
|
|
232
232
|
}).then((data) => {
|
|
233
|
-
localStorage.setItem('
|
|
233
|
+
localStorage.setItem('key', data['key']);
|
|
234
234
|
localStorage.setItem('organization_id', data.document[0]['current_org']);
|
|
235
235
|
localStorage.setItem('host', crud.socket.config.host);
|
|
236
236
|
|
|
@@ -258,7 +258,7 @@ action.init({
|
|
|
258
258
|
name: "signIn",
|
|
259
259
|
endEvent: "signIn",
|
|
260
260
|
callback: (btn, data) => {
|
|
261
|
-
CoCreateUser.
|
|
261
|
+
CoCreateUser.signIn(btn, data);
|
|
262
262
|
},
|
|
263
263
|
});
|
|
264
264
|
|