@yourself_id/siwys-react-js 0.0.24-sapp-106-export-qr-code.0 → 0.0.24
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,8 @@ declare const SiwysButton: React.FC<ButtonProps>;
|
|
|
14
14
|
|
|
15
15
|
interface SignInProps {
|
|
16
16
|
createChallengeUrl: string;
|
|
17
|
-
|
|
17
|
+
pollForAuthUrl?: string;
|
|
18
|
+
pollingIntervalSec?: number;
|
|
18
19
|
}
|
|
19
20
|
declare const SignInWithYourSelf: React.FC<SignInProps>;
|
|
20
21
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ declare const SiwysButton: React.FC<ButtonProps>;
|
|
|
14
14
|
|
|
15
15
|
interface SignInProps {
|
|
16
16
|
createChallengeUrl: string;
|
|
17
|
-
|
|
17
|
+
pollForAuthUrl?: string;
|
|
18
|
+
pollingIntervalSec?: number;
|
|
18
19
|
}
|
|
19
20
|
declare const SignInWithYourSelf: React.FC<SignInProps>;
|
|
20
21
|
|
package/dist/index.js
CHANGED
|
@@ -1099,7 +1099,7 @@ var InstructionsWrapper = import_styled_components7.default.div(_templateObject2
|
|
|
1099
1099
|
var InstructionsSet = import_styled_components7.default.div(_templateObject21());
|
|
1100
1100
|
var List = import_styled_components7.default.ol(_templateObject22());
|
|
1101
1101
|
var SignInWithYourSelf = function(param) {
|
|
1102
|
-
var createChallengeUrl = param.createChallengeUrl,
|
|
1102
|
+
var createChallengeUrl = param.createChallengeUrl, pollForAuthUrl = param.pollForAuthUrl, _param_pollingIntervalSec = param.pollingIntervalSec, pollingIntervalSec = _param_pollingIntervalSec === void 0 ? 5 : _param_pollingIntervalSec;
|
|
1103
1103
|
var _ref = _sliced_to_array((0, import_react7.useState)(""), 2), challengeDid = _ref[0], setChallengeDid = _ref[1];
|
|
1104
1104
|
var _ref1 = _sliced_to_array((0, import_react7.useState)(""), 2), challengeUrl = _ref1[0], setChallengeUrl = _ref1[1];
|
|
1105
1105
|
var _ref2 = _sliced_to_array((0, import_react7.useState)(false), 2), isAuthenticated = _ref2[0], setIsAuthenticated = _ref2[1];
|
|
@@ -1114,10 +1114,10 @@ var SignInWithYourSelf = function(param) {
|
|
|
1114
1114
|
});
|
|
1115
1115
|
}, []);
|
|
1116
1116
|
(0, import_react7.useEffect)(function() {
|
|
1117
|
-
if (!challengeDid || isAuthenticated) return;
|
|
1117
|
+
if (!pollForAuthUrl || !challengeDid || isAuthenticated) return;
|
|
1118
1118
|
var interval = setInterval(/*#__PURE__*/ _async_to_generator(function() {
|
|
1119
1119
|
return _ts_generator(this, function(_state) {
|
|
1120
|
-
fetch(
|
|
1120
|
+
fetch(pollForAuthUrl + "?challenge=".concat(challengeDid)).then(function(resp) {
|
|
1121
1121
|
if (resp.status === 200) {
|
|
1122
1122
|
return resp.json();
|
|
1123
1123
|
}
|
|
@@ -1133,13 +1133,14 @@ var SignInWithYourSelf = function(param) {
|
|
|
1133
1133
|
2
|
|
1134
1134
|
];
|
|
1135
1135
|
});
|
|
1136
|
-
}),
|
|
1136
|
+
}), pollingIntervalSec * 1e3);
|
|
1137
1137
|
return function() {
|
|
1138
1138
|
clearInterval(interval);
|
|
1139
1139
|
};
|
|
1140
1140
|
}, [
|
|
1141
1141
|
challengeDid,
|
|
1142
|
-
isAuthenticated
|
|
1142
|
+
isAuthenticated,
|
|
1143
|
+
pollForAuthUrl
|
|
1143
1144
|
]);
|
|
1144
1145
|
return /* @__PURE__ */ import_react7.default.createElement(Wrapper4, null, /* @__PURE__ */ import_react7.default.createElement(GlobalStyle, null), /* @__PURE__ */ import_react7.default.createElement(ModalWrapper, null, isAuthenticated && /* @__PURE__ */ import_react7.default.createElement(Success_default, null), !isAuthenticated && /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(Challenge_default, {
|
|
1145
1146
|
challengeUrl: challengeUrl
|