@cocreate/authorize 1.8.0 → 1.8.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,14 @@
1
+ ## [1.8.1](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.8.0...v1.8.1) (2023-11-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * meta name typo ([a21a4b5](https://github.com/CoCreate-app/CoCreate-authorize/commit/a21a4b5a8b92d17dabb9d60274526e43235ef9d5))
7
+ * return error if no authorization.actions ([61cff63](https://github.com/CoCreate-app/CoCreate-authorize/commit/61cff637a565305032fc4356b24b039e428d7b6d))
8
+ * typos ([48eecb4](https://github.com/CoCreate-app/CoCreate-authorize/commit/48eecb43925bf0b70d7daabb5e82a5d7cd5e305f))
9
+ * update crud methods ([c416245](https://github.com/CoCreate-app/CoCreate-authorize/commit/c41624522c9688321b5cdb7c2c401b38cc057ead))
10
+ * update host ([a86a448](https://github.com/CoCreate-app/CoCreate-authorize/commit/a86a4489d6fbc18c3989735db1edf4fb0125fb15))
11
+
1
12
  # [1.8.0](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.7.6...v1.8.0) (2023-11-03)
2
13
 
3
14
 
@@ -12,8 +12,7 @@ module.exports = {
12
12
  "pathname": "/docs/authorize/index.html",
13
13
  "src": "{{./docs/index.html}}",
14
14
  "host": [
15
- "*",
16
- "general.cocreate.app"
15
+ "*"
17
16
  ],
18
17
  "directory": "authorize",
19
18
  "content-type": "text/html",
package/docs/index.html CHANGED
@@ -11,10 +11,10 @@
11
11
  sizes="32x32"
12
12
  href="https://cocreate.app/images/favicon.ico" />
13
13
  <meta
14
- key="description"
14
+ name="description"
15
15
  content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
16
16
  <meta
17
- key="keywords"
17
+ name="keywords"
18
18
  content="helper classes, utility classes, css framework, css library, inline style classes" />
19
19
  <meta name="robots" content="index,follow" />
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/authorize",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "A simple authorize component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "authorize",
package/src/index.js CHANGED
@@ -18,11 +18,11 @@
18
18
  const organizations = {}
19
19
 
20
20
  if (isBrowser) {
21
- crud.listen('update.object', function (data) {
21
+ crud.listen('object.update', function (data) {
22
22
  updateAuthorization(data)
23
23
  });
24
24
 
25
- crud.listen('delete.object', function (data) {
25
+ crud.listen('object.delete', function (data) {
26
26
  deleteAuthorization(data)
27
27
  });
28
28
  } else {
@@ -190,6 +190,8 @@
190
190
  }
191
191
  if (authorized.admin === 'true' || authorized.admin === true)
192
192
  return true;
193
+ if (!authorized.actions)
194
+ return { error: "Authorization does not have any actions defined" };
193
195
 
194
196
  let status = await checkMethod(data, authorized.actions, data.method)
195
197
 
@@ -238,7 +240,7 @@
238
240
  return !!authorized
239
241
  } else {
240
242
  let status = false
241
- let newmatch = data.method.replace(match, '')
243
+ let newmatch = data.method.replace(match + '.', '')
242
244
 
243
245
  if (Array.isArray(authorized)) {
244
246
  for (let i = 0; i < authorized.length; i++) {