tinacms-clerk 10.0.6 → 10.0.8
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/dist/index.js +3 -6
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var ClerkBackendAuthentication = ({
|
|
|
34
34
|
return {
|
|
35
35
|
isAuthorized: async (req, _res) => {
|
|
36
36
|
const token = req.headers["authorization"];
|
|
37
|
-
const tokenWithoutBearer = token
|
|
37
|
+
const tokenWithoutBearer = token?.replace("Bearer ", "").trim();
|
|
38
38
|
const requestState = await clerk.authenticateRequest({
|
|
39
39
|
headerToken: tokenWithoutBearer
|
|
40
40
|
});
|
|
@@ -43,10 +43,7 @@ var ClerkBackendAuthentication = ({
|
|
|
43
43
|
if (orgId) {
|
|
44
44
|
const membershipList = (await clerk.organizations.getOrganizationMembershipList({
|
|
45
45
|
organizationId: orgId
|
|
46
|
-
})).map((x) =>
|
|
47
|
-
var _a;
|
|
48
|
-
return (_a = x.publicUserData) == null ? void 0 : _a.userId;
|
|
49
|
-
});
|
|
46
|
+
})).map((x) => x.publicUserData?.userId);
|
|
50
47
|
if (!membershipList.includes(user.id))
|
|
51
48
|
return {
|
|
52
49
|
isAuthorized: false,
|
|
@@ -60,7 +57,7 @@ var ClerkBackendAuthentication = ({
|
|
|
60
57
|
if (primaryEmail && !allowList) {
|
|
61
58
|
return { isAuthorized: true };
|
|
62
59
|
}
|
|
63
|
-
if (primaryEmail &&
|
|
60
|
+
if (primaryEmail && allowList?.includes(primaryEmail.emailAddress)) {
|
|
64
61
|
return { isAuthorized: true };
|
|
65
62
|
}
|
|
66
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms-clerk",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@clerk/clerk-js": "4.56.2",
|
|
23
23
|
"@types/node": "^22.13.1",
|
|
24
24
|
"typescript": "^5.7.3",
|
|
25
|
-
"
|
|
26
|
-
"tinacms": "
|
|
25
|
+
"tinacms": "2.7.8",
|
|
26
|
+
"@tinacms/scripts": "1.3.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@clerk/backend": "0.x",
|
|
30
30
|
"@clerk/clerk-js": "4.x",
|
|
31
|
-
"tinacms": "2.7.
|
|
31
|
+
"tinacms": "2.7.8"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"registry": "https://registry.npmjs.org"
|