@cocreate/socket-server 1.13.0 → 1.13.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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.13.2](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.13.1...v1.13.2) (2023-06-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * renamed db to storage ([4766428](https://github.com/CoCreate-app/CoCreate-socket-server/commit/4766428c38e542282c301c457420dd3405a78206))
7
+ * renamed hosts to host. the value can be a string or an array of strings ([3c60a40](https://github.com/CoCreate-app/CoCreate-socket-server/commit/3c60a40d48dfd9b3343dfa738bb290cc47fb4766))
8
+
9
+ ## [1.13.1](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.13.0...v1.13.1) (2023-06-10)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Refactor authentication method to use token decoding 🚀 ([249cf69](https://github.com/CoCreate-app/CoCreate-socket-server/commit/249cf69c3ce918a2d5bee324456008e1923d8226))
15
+ * Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([b7d21f3](https://github.com/CoCreate-app/CoCreate-socket-server/commit/b7d21f334dd160fbad19b4f3539b6adfbfed9861))
16
+
1
17
  # [1.13.0](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.12.1...v1.13.0) (2023-06-10)
2
18
 
3
19
 
@@ -10,7 +10,7 @@ module.exports = {
10
10
  "name": "index.html",
11
11
  "path": "/docs/socket-server/index.html",
12
12
  "src": "{{./docs/index.html}}",
13
- "hosts": [
13
+ "host": [
14
14
  "*",
15
15
  "general.cocreate.app"
16
16
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/socket-server",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "CoCreate-socket-server",
5
5
  "keywords": [
6
6
  "cocreate-socket",
@@ -27,7 +27,6 @@
27
27
  "scripts": {
28
28
  "demo": "PORT=5000 node demo/server.js",
29
29
  "test": "echo \"Error: no test specified\" && exit 1",
30
- "docs": "node ./node_modules/@cocreate/docs/src/index.js",
31
30
  "postinstall": "node ./node_modules/@cocreate/cli/check-coc.js"
32
31
  },
33
32
  "repository": {
@@ -44,8 +43,7 @@
44
43
  "@cocreate/cli": "^1.29.3"
45
44
  },
46
45
  "dependencies": {
47
- "@cocreate/docs": "^1.8.13",
48
- "@cocreate/uuid": "^1.4.15",
46
+ "@cocreate/uuid": "^1.4.16",
49
47
  "ws": "7.5.9"
50
48
  }
51
49
  }
package/src/index.js CHANGED
@@ -129,12 +129,12 @@ class SocketServer extends EventEmitter {
129
129
  });
130
130
  let user_id = null;
131
131
  if (this.authenticate)
132
- user_id = await this.authenticate.getUserId(req);
132
+ user_id = await this.authenticate.decodeToken(req);
133
133
 
134
134
  if (this.authorize) {
135
135
  data.host = this.getHost(req)
136
136
  const permission = await this.authorize.check(action, data, user_id)
137
- if (permission.dbUrl === false) {
137
+ if (permission.storage === false) {
138
138
  data.database = process.env.organization_id
139
139
  data.organization_id = process.env.organization_id
140
140