authscape 1.0.108 → 1.0.110
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 +11 -3
- package/package.json +1 -1
- package/src/index.js +12 -12
- package/src/services/authService.js +9 -2
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
|
@@ -1066,11 +1066,15 @@ var authService = function authService() {
|
|
|
1066
1066
|
},
|
|
1067
1067
|
logout: function () {
|
|
1068
1068
|
var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1069
|
-
var
|
|
1069
|
+
var redirectUri,
|
|
1070
|
+
AuthUri,
|
|
1071
|
+
cookieDomain,
|
|
1072
|
+
_args3 = arguments;
|
|
1070
1073
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1071
1074
|
while (1) {
|
|
1072
1075
|
switch (_context3.prev = _context3.next) {
|
|
1073
1076
|
case 0:
|
|
1077
|
+
redirectUri = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : null;
|
|
1074
1078
|
AuthUri = process.env.AUTHORITYURI;
|
|
1075
1079
|
cookieDomain = process.env.cookieDomain;
|
|
1076
1080
|
(0, _nookies.destroyCookie)({}, "access_token", {
|
|
@@ -1089,10 +1093,14 @@ var authService = function authService() {
|
|
|
1089
1093
|
domain: cookieDomain
|
|
1090
1094
|
});
|
|
1091
1095
|
setTimeout(function () {
|
|
1092
|
-
|
|
1096
|
+
if (redirectUri == null) {
|
|
1097
|
+
window.location.href = AuthUri + "/connect/logout?redirect=" + window.location.href;
|
|
1098
|
+
} else {
|
|
1099
|
+
window.location.href = AuthUri + "/connect/logout?redirect=" + redirectUri;
|
|
1100
|
+
}
|
|
1093
1101
|
}, 500);
|
|
1094
1102
|
|
|
1095
|
-
case
|
|
1103
|
+
case 7:
|
|
1096
1104
|
case "end":
|
|
1097
1105
|
return _context3.stop();
|
|
1098
1106
|
}
|
package/package.json
CHANGED
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
|
}
|
|
@@ -76,7 +76,7 @@ export const authService = () => {
|
|
|
76
76
|
|
|
77
77
|
window.location.href = url;
|
|
78
78
|
},
|
|
79
|
-
logout: async () => {
|
|
79
|
+
logout: async (redirectUri = null) => {
|
|
80
80
|
|
|
81
81
|
let AuthUri = process.env.AUTHORITYURI;
|
|
82
82
|
let cookieDomain = process.env.cookieDomain;
|
|
@@ -100,7 +100,14 @@ export const authService = () => {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
setTimeout(() => {
|
|
103
|
-
|
|
103
|
+
if (redirectUri == null)
|
|
104
|
+
{
|
|
105
|
+
window.location.href = AuthUri + "/connect/logout?redirect=" + window.location.href;
|
|
106
|
+
}
|
|
107
|
+
else
|
|
108
|
+
{
|
|
109
|
+
window.location.href = AuthUri + "/connect/logout?redirect=" + redirectUri;
|
|
110
|
+
}
|
|
104
111
|
}, 500);
|
|
105
112
|
|
|
106
113
|
},
|