@trycourier/react-hooks 6.4.2-internal.8dff613.0 → 7.0.0
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/use-transport.js +3 -5
- package/package.json +5 -5
package/dist/use-transport.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,7 +9,7 @@ var _react = require("react");
|
|
|
11
9
|
|
|
12
10
|
var _transport = require("@trycourier/transport");
|
|
13
11
|
|
|
14
|
-
var _jwtDecode =
|
|
12
|
+
var _jwtDecode = require("jwt-decode");
|
|
15
13
|
|
|
16
14
|
var useTransport = function useTransport(_ref) {
|
|
17
15
|
var authorization = _ref.authorization,
|
|
@@ -33,8 +31,8 @@ var useTransport = function useTransport(_ref) {
|
|
|
33
31
|
if (authorization && transportRef !== null && transportRef !== void 0 && (_transportRef$current = transportRef.current) !== null && _transportRef$current !== void 0 && _transportRef$current.authorization && transportRef !== null && transportRef !== void 0 && transportRef.current.transport) {
|
|
34
32
|
var _transportRef$current2;
|
|
35
33
|
|
|
36
|
-
var oldDecodedAuth = (0, _jwtDecode
|
|
37
|
-
var newDecodedAuth = (0, _jwtDecode
|
|
34
|
+
var oldDecodedAuth = (0, _jwtDecode.jwtDecode)(transportRef === null || transportRef === void 0 ? void 0 : (_transportRef$current2 = transportRef.current) === null || _transportRef$current2 === void 0 ? void 0 : _transportRef$current2.authorization);
|
|
35
|
+
var newDecodedAuth = (0, _jwtDecode.jwtDecode)(authorization);
|
|
38
36
|
|
|
39
37
|
if (oldDecodedAuth.scope === newDecodedAuth.scope && oldDecodedAuth.tenantId === newDecodedAuth.tenantId) {
|
|
40
38
|
transportRef.current.transport.renewSession(authorization);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"concat-md": "^0.3.5"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@trycourier/client-graphql": "^
|
|
24
|
-
"@trycourier/core": "^
|
|
23
|
+
"@trycourier/client-graphql": "^7.0.0",
|
|
24
|
+
"@trycourier/core": "^7.0.0",
|
|
25
25
|
"deep-extend": "^0.6.0",
|
|
26
|
-
"rimraf": "^
|
|
26
|
+
"rimraf": "^5.0.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@trycourier/react-provider": ">=4.X.X",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
},
|
|
47
47
|
"./use-inbox": "./dist/inbox/use-inbox.js"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "e7d4f8aae2ecfa9bfa9741f5a10a46624c3af3ee"
|
|
50
50
|
}
|