@cocreate/authorize 1.7.4 → 1.7.6
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 +3 -3
- package/src/index.js +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.7.6](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.7.5...v1.7.6) (2023-10-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* await key to resolve, update filters ([f69bdb7](https://github.com/CoCreate-app/CoCreate-authorize/commit/f69bdb72fe8c4b7ce8a2993699c8611442373e12))
|
|
7
|
+
|
|
8
|
+
## [1.7.5](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.7.4...v1.7.5) (2023-10-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies ([bc6d918](https://github.com/CoCreate-app/CoCreate-authorize/commit/bc6d9185e5a1881fdb2753ac8191a2949b49a63d))
|
|
14
|
+
|
|
1
15
|
## [1.7.4](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.7.3...v1.7.4) (2023-10-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/authorize",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"main": "./src/index.js",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cocreate/crud-client": "^1.28.
|
|
49
|
-
"@cocreate/utils": "^1.
|
|
48
|
+
"@cocreate/crud-client": "^1.28.10",
|
|
49
|
+
"@cocreate/utils": "^1.26.1"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/index.js
CHANGED
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
|
|
65
65
|
async function getAuthorization(key, organization_id) {
|
|
66
66
|
// Check if there is a value orpending promise for this key
|
|
67
|
-
if (authorizations.has(key)) {
|
|
67
|
+
if (key && authorizations.has(key)) {
|
|
68
68
|
// Return the value or pending promise
|
|
69
|
-
return authorizations.get(key);
|
|
69
|
+
return await authorizations.get(key);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// Create a new promise and store it
|
|
@@ -97,17 +97,16 @@
|
|
|
97
97
|
method: 'read.object',
|
|
98
98
|
array: 'keys',
|
|
99
99
|
organization_id,
|
|
100
|
-
object: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
100
|
+
object: {},
|
|
101
|
+
$filter: {
|
|
102
|
+
query: []
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
if (key)
|
|
108
|
-
request
|
|
107
|
+
request.$filter.query.push({ key: 'key', value: key, operator: '$eq' })
|
|
109
108
|
else
|
|
110
|
-
request
|
|
109
|
+
request.$filter.query.push({ key: 'default', value: true, operator: '$eq' })
|
|
111
110
|
|
|
112
111
|
|
|
113
112
|
let authorization = await crud.send(request)
|