@trackunit/react-core-contexts 0.4.92 → 0.4.93

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 (3) hide show
  1. package/index.cjs +14 -1
  2. package/index.js +14 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -116,8 +116,21 @@ const ManagerApolloProvider = ({ children, isIrisApp }) => {
116
116
  });
117
117
  }
118
118
  }
119
- const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => { var _a, _b; return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" || ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified")); });
119
+ const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => {
120
+ var _a, _b, _c;
121
+ return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" ||
122
+ ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified")) ||
123
+ ((_c = x === null || x === void 0 ? void 0 : x.message) === null || _c === void 0 ? void 0 : _c.includes("Access denied! You need to be authorized to perform this action!"));
124
+ });
120
125
  if (invalidToken) {
126
+ Sentry__namespace.captureException({
127
+ category: "GraphQL",
128
+ message: "GraphQL Error - invalidToken",
129
+ level: "warning",
130
+ data: {
131
+ log: JSON.stringify(errorResponse.graphQLErrors),
132
+ },
133
+ });
121
134
  window.location.replace(`${publicUrl}logout`);
122
135
  }
123
136
  if (errorResponse.networkError) {
package/index.js CHANGED
@@ -92,8 +92,21 @@ const ManagerApolloProvider = ({ children, isIrisApp }) => {
92
92
  });
93
93
  }
94
94
  }
95
- const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => { var _a, _b; return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" || ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified")); });
95
+ const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => {
96
+ var _a, _b, _c;
97
+ return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" ||
98
+ ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified")) ||
99
+ ((_c = x === null || x === void 0 ? void 0 : x.message) === null || _c === void 0 ? void 0 : _c.includes("Access denied! You need to be authorized to perform this action!"));
100
+ });
96
101
  if (invalidToken) {
102
+ Sentry.captureException({
103
+ category: "GraphQL",
104
+ message: "GraphQL Error - invalidToken",
105
+ level: "warning",
106
+ data: {
107
+ log: JSON.stringify(errorResponse.graphQLErrors),
108
+ },
109
+ });
97
110
  window.location.replace(`${publicUrl}logout`);
98
111
  }
99
112
  if (errorResponse.networkError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts",
3
- "version": "0.4.92",
3
+ "version": "0.4.93",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {