authscape 1.0.82 → 1.0.88
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/.babelrc +2 -2
- package/index.js +13 -14
- package/package.json +5 -5
- package/src/components/{dataTable.js → Datatable.js} +1 -1
- package/src/index.js +12 -12
- package/src/services/apiService.js +7 -5
package/.babelrc
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": ["@babel/preset-react", "@babel/preset-env"]
|
|
1
|
+
{
|
|
2
|
+
"presets": ["@babel/preset-react", "@babel/preset-env"]
|
|
3
3
|
}
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.Datatable = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -245,7 +245,7 @@ var Datatable = /*#__PURE__*/function (_Component) {
|
|
|
245
245
|
return Datatable;
|
|
246
246
|
}(_react.Component);
|
|
247
247
|
|
|
248
|
-
exports
|
|
248
|
+
exports.Datatable = Datatable;
|
|
249
249
|
|
|
250
250
|
_defineProperty(Datatable, "defaultProps", {
|
|
251
251
|
options: {}
|
|
@@ -391,7 +391,7 @@ var setupDefaultOptions = /*#__PURE__*/function () {
|
|
|
391
391
|
|
|
392
392
|
var RefreshToken = /*#__PURE__*/function () {
|
|
393
393
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(originalRequest, instance) {
|
|
394
|
-
var accessToken, refreshToken, response
|
|
394
|
+
var accessToken, refreshToken, response;
|
|
395
395
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
396
396
|
while (1) {
|
|
397
397
|
switch (_context2.prev = _context2.next) {
|
|
@@ -415,39 +415,38 @@ var RefreshToken = /*#__PURE__*/function () {
|
|
|
415
415
|
response = _context2.sent;
|
|
416
416
|
|
|
417
417
|
if (!(response != null && response.status == 200)) {
|
|
418
|
-
_context2.next =
|
|
418
|
+
_context2.next = 13;
|
|
419
419
|
break;
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
|
|
423
|
-
|
|
424
|
-
_context2.next = 10;
|
|
423
|
+
_context2.next = 9;
|
|
425
424
|
return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
|
|
426
425
|
maxAge: 2147483647,
|
|
427
426
|
path: '/',
|
|
428
|
-
domain:
|
|
427
|
+
domain: process.env.cookieDomain,
|
|
429
428
|
secure: true
|
|
430
429
|
});
|
|
431
430
|
|
|
432
|
-
case
|
|
433
|
-
_context2.next =
|
|
431
|
+
case 9:
|
|
432
|
+
_context2.next = 11;
|
|
434
433
|
return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
|
|
435
434
|
maxAge: 2147483647,
|
|
436
435
|
path: '/',
|
|
437
|
-
domain:
|
|
436
|
+
domain: process.env.cookieDomain,
|
|
438
437
|
secure: true
|
|
439
438
|
});
|
|
440
439
|
|
|
441
|
-
case
|
|
442
|
-
_context2.next =
|
|
440
|
+
case 11:
|
|
441
|
+
_context2.next = 13;
|
|
443
442
|
return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
|
|
444
443
|
maxAge: 2147483647,
|
|
445
444
|
path: '/',
|
|
446
|
-
domain:
|
|
445
|
+
domain: process.env.cookieDomain,
|
|
447
446
|
secure: true
|
|
448
447
|
});
|
|
449
448
|
|
|
450
|
-
case
|
|
449
|
+
case 13:
|
|
451
450
|
case "end":
|
|
452
451
|
return _context2.stop();
|
|
453
452
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.88",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"next-cookies": "^2.0.3",
|
|
17
17
|
"nookies": "^2.5.2",
|
|
18
18
|
"querystring": "^0.2.1",
|
|
19
|
-
"react": "^
|
|
20
|
-
"react-dom": "^
|
|
19
|
+
"react": "^17.0.2",
|
|
20
|
+
"react-dom": "^17.0.2",
|
|
21
21
|
"react-data-table-component": "^7.5.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@babel/core": "^7.1.6",
|
|
26
26
|
"@babel/preset-env": "^7.1.6",
|
|
27
27
|
"@babel/preset-react": "^7.0.0",
|
|
28
|
-
"react": "^
|
|
29
|
-
"react-dom": "^
|
|
28
|
+
"react": "^17.0.2",
|
|
29
|
+
"react-dom": "^17.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"axios": "^0.27.2",
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
//import {apiService} from 'authscape';
|
|
3
3
|
import DataTable, {createTheme} from "react-data-table-component";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export class Datatable extends Component {
|
|
6
6
|
|
|
7
7
|
static defaultProps = {
|
|
8
8
|
options: {}
|
package/src/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
|
|
3
|
-
export default class DummyComponent extends Component {
|
|
4
|
-
|
|
5
|
-
render () {
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div>I am a dummy react npm module</div>
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
|
|
3
|
+
export default class DummyComponent extends Component {
|
|
4
|
+
|
|
5
|
+
render () {
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div>I am a dummy react npm module</div>
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
13
|
}
|
|
@@ -59,13 +59,11 @@ const RefreshToken = async (originalRequest, instance) => {
|
|
|
59
59
|
{
|
|
60
60
|
originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
|
|
61
61
|
|
|
62
|
-
let domain = getCookieDomain();
|
|
63
|
-
|
|
64
62
|
await setCookie(null, "access_token", response.data.access_token,
|
|
65
63
|
{
|
|
66
64
|
maxAge: 2147483647,
|
|
67
65
|
path: '/',
|
|
68
|
-
domain:
|
|
66
|
+
domain: process.env.cookieDomain,
|
|
69
67
|
secure: true
|
|
70
68
|
});
|
|
71
69
|
|
|
@@ -73,7 +71,7 @@ const RefreshToken = async (originalRequest, instance) => {
|
|
|
73
71
|
{
|
|
74
72
|
maxAge: 2147483647,
|
|
75
73
|
path: '/',
|
|
76
|
-
domain:
|
|
74
|
+
domain: process.env.cookieDomain,
|
|
77
75
|
secure: true
|
|
78
76
|
});
|
|
79
77
|
|
|
@@ -81,7 +79,7 @@ const RefreshToken = async (originalRequest, instance) => {
|
|
|
81
79
|
{
|
|
82
80
|
maxAge: 2147483647,
|
|
83
81
|
path: '/',
|
|
84
|
-
domain:
|
|
82
|
+
domain: process.env.cookieDomain,
|
|
85
83
|
secure: true
|
|
86
84
|
});
|
|
87
85
|
}
|
|
@@ -217,6 +215,10 @@ export const apiService = (ctx = {}) => {
|
|
|
217
215
|
{
|
|
218
216
|
return response.data;
|
|
219
217
|
}
|
|
218
|
+
// else if (response != null && response.status == 401)
|
|
219
|
+
// {
|
|
220
|
+
// // call the login window maybe?
|
|
221
|
+
// }
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
} catch(exp) {
|