shuttlepro-shared 1.1.25 → 1.1.26

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.
@@ -12,7 +12,12 @@ exports.checkPermission = async (req, res, next, values) => {
12
12
  req.headers && req.headers.authorization
13
13
  ? req.headers.authorization
14
14
  : null;
15
+ console.log(token, "token");
16
+ if (req?.headers["x-api-key"] === process.env.API_KEY) {
17
+ return next();
18
+ }
15
19
  if (token) {
20
+ console.log("part 1");
16
21
  const workspaceId =
17
22
  req.query?.workspaceId ||
18
23
  req.params?.workspaceId ||
@@ -54,9 +59,6 @@ exports.checkPermission = async (req, res, next, values) => {
54
59
  code: HttpStatusCode.UNAUTHORIZED,
55
60
  message: GenericMessages.PERMISSION_DENIED,
56
61
  });
57
- } else if (req?.headers["x-api-key"] == process.env.API_KEY) {
58
- console.log("here");
59
- next();
60
62
  } else {
61
63
  return res.status(HttpStatusCode.UNAUTHORIZED).json({
62
64
  code: HttpStatusCode.UNAUTHORIZED,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {