tinacms-clerk 0.0.0-d7c745e-20250102002342 → 0.0.0-d94de9b-20250707010010

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
19
  // src/index.ts
20
- var src_exports = {};
21
- __export(src_exports, {
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
22
  ClerkBackendAuthentication: () => ClerkBackendAuthentication
23
23
  });
24
- module.exports = __toCommonJS(src_exports);
24
+ module.exports = __toCommonJS(index_exports);
25
25
  var import_backend = require("@clerk/backend");
26
26
  var ClerkBackendAuthentication = ({
27
27
  secretKey,
@@ -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 == null ? void 0 : token.replace("Bearer ", "").trim();
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 && (allowList == null ? void 0 : allowList.includes(primaryEmail.emailAddress))) {
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": "0.0.0-d7c745e-20250102002342",
3
+ "version": "0.0.0-d94de9b-20250707010010",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "files": [
@@ -20,15 +20,15 @@
20
20
  "devDependencies": {
21
21
  "@clerk/backend": "0.31.3",
22
22
  "@clerk/clerk-js": "4.56.2",
23
- "@types/node": "^22.9.0",
24
- "typescript": "^5.6.3",
25
- "@tinacms/scripts": "1.3.1",
26
- "tinacms": "0.0.0-d7c745e-20250102002342"
23
+ "@types/node": "^22.13.1",
24
+ "typescript": "^5.7.3",
25
+ "@tinacms/scripts": "1.3.5",
26
+ "tinacms": "0.0.0-d94de9b-20250707010010"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@clerk/backend": "0.x",
30
30
  "@clerk/clerk-js": "4.x",
31
- "tinacms": "0.0.0-d7c745e-20250102002342"
31
+ "tinacms": "0.0.0-d94de9b-20250707010010"
32
32
  },
33
33
  "publishConfig": {
34
34
  "registry": "https://registry.npmjs.org"