@redocly/replay 0.18.0-next.1 → 0.18.0-next.3
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/oauth2-redirect.cjs +3 -3
- package/dist/oauth2-redirect.d.ts +0 -10
- package/dist/oauth2-redirect.js +28 -29
- package/dist/replay-index-CZaE-pRR.js +134 -0
- package/dist/{replay-index-DM4kGyuL.js → replay-index-DBXFZneT.js} +6538 -6559
- package/dist/{replay-index-y3pvXgBP.js → replay-index-DXfrp-OC.js} +1 -1
- package/dist/{replay-index-DPVVIR4i.js → replay-index-DlQPih5l.js} +1 -1
- package/dist/replay-index-lM29rXxS.js +4307 -0
- package/dist/{replay-index-D-GwImOJ.js → replay-index-wO1crrTZ.js} +26928 -32702
- package/dist/{replay-tauri-path-sMFxMpbK.js → replay-tauri-path-CKOyn3xQ.js} +1 -1
- package/dist/{replay-tauri-path-CturJpPH.js → replay-tauri-path-D5kjpgEq.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +0 -10
- package/dist/replay.js +1 -1
- package/package.json +8 -8
- package/dist/replay-index-CfH4WmU1.js +0 -134
- package/dist/replay-index-hXC9mqMj.js +0 -4310
package/dist/oauth2-redirect.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s="Something went wrong, please, try again.";function c(e){return e&&e.replace(/=+$/,"")}function l(e,r){return!!e&&!!r&&c(e)===c(r)}function d(e){let r;if(/code|token|error/.test(window.location.hash)?r=window.location.hash.substring(1):r=location.search.substring(1),!r)throw console.error("No query string in OAuth 2 redirect URL"),new Error(s);const o=new URLSearchParams(r),t=o.get("access_token"),n=o.get("code"),i=o.get("token_type"),a=o.get("expires_in"),u=o.get("state"),h=o.get("error"),w=o.get("error_description")||s;if(h)throw new Error(w);if(!l(u,e?.state))throw new Error("Outdated OAuth2 state");if(e?.flow==="implicit"){if(!t)throw new Error(`Your OAuth2 authentication service provider redirected you without an "access_token".
|
|
2
2
|
Please, try again or make sure your OAuth2 settings are correct.`);if(!i)throw new Error(`Your OAuth2 authentication service provider redirected you without a "token_type".
|
|
3
|
-
Please, try again or make sure your OAuth2 settings are correct.`);
|
|
4
|
-
Please, try again or make sure your OAuth2 settings are correct.`);
|
|
3
|
+
Please, try again or make sure your OAuth2 settings are correct.`);e?.successCallback({access_token:t,token_type:i,expires_in:a,auth_code:""})}if(e?.flow==="authorizationCode"){if(!n)throw new Error(`Your OAuth2 authentication service provider redirected you without authorization "code".
|
|
4
|
+
Please, try again or make sure your OAuth2 settings are correct.`);e?.successCallback({auth_code:n,access_token:"",token_type:"bearer"})}}function g(){const e=window.opener?.redirectOAuth2;try{d(e)}catch(r){e?.errorCallback(r)}window.close()}window.onload=g;
|
package/dist/oauth2-redirect.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
const s = "Something went wrong, please, try again.";
|
|
2
|
+
function c(e) {
|
|
3
|
+
return e && e.replace(/=+$/, "");
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return !!
|
|
5
|
+
function l(e, r) {
|
|
6
|
+
return !!e && !!r && c(e) === c(r);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
if (/code|token|error/.test(window.location.hash) ?
|
|
11
|
-
throw console.error("No query string in OAuth 2 redirect URL"), new Error(
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
throw new Error(
|
|
15
|
-
if (!
|
|
8
|
+
function d(e) {
|
|
9
|
+
let r;
|
|
10
|
+
if (/code|token|error/.test(window.location.hash) ? r = window.location.hash.substring(1) : r = location.search.substring(1), !r)
|
|
11
|
+
throw console.error("No query string in OAuth 2 redirect URL"), new Error(s);
|
|
12
|
+
const o = new URLSearchParams(r), t = o.get("access_token"), n = o.get("code"), i = o.get("token_type"), a = o.get("expires_in"), u = o.get("state"), h = o.get("error"), w = o.get("error_description") || s;
|
|
13
|
+
if (h)
|
|
14
|
+
throw new Error(w);
|
|
15
|
+
if (!l(u, e?.state))
|
|
16
16
|
throw new Error("Outdated OAuth2 state");
|
|
17
|
-
if (
|
|
18
|
-
if (!
|
|
17
|
+
if (e?.flow === "implicit") {
|
|
18
|
+
if (!t)
|
|
19
19
|
throw new Error(
|
|
20
20
|
`Your OAuth2 authentication service provider redirected you without an "access_token".
|
|
21
21
|
Please, try again or make sure your OAuth2 settings are correct.`
|
|
@@ -25,34 +25,33 @@ Please, try again or make sure your OAuth2 settings are correct.`
|
|
|
25
25
|
`Your OAuth2 authentication service provider redirected you without a "token_type".
|
|
26
26
|
Please, try again or make sure your OAuth2 settings are correct.`
|
|
27
27
|
);
|
|
28
|
-
|
|
29
|
-
access_token:
|
|
28
|
+
e?.successCallback({
|
|
29
|
+
access_token: t,
|
|
30
30
|
token_type: i,
|
|
31
|
-
expires_in:
|
|
31
|
+
expires_in: a,
|
|
32
32
|
auth_code: ""
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
if (!
|
|
35
|
+
if (e?.flow === "authorizationCode") {
|
|
36
|
+
if (!n)
|
|
37
37
|
throw new Error(
|
|
38
38
|
`Your OAuth2 authentication service provider redirected you without authorization "code".
|
|
39
39
|
Please, try again or make sure your OAuth2 settings are correct.`
|
|
40
40
|
);
|
|
41
|
-
|
|
42
|
-
auth_code:
|
|
41
|
+
e?.successCallback({
|
|
42
|
+
auth_code: n,
|
|
43
43
|
access_token: "",
|
|
44
44
|
token_type: "bearer"
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
const o = (e = window.opener) == null ? void 0 : e.redirectOAuth2;
|
|
48
|
+
function g() {
|
|
49
|
+
const e = window.opener?.redirectOAuth2;
|
|
51
50
|
try {
|
|
52
|
-
|
|
53
|
-
} catch (
|
|
54
|
-
|
|
51
|
+
d(e);
|
|
52
|
+
} catch (r) {
|
|
53
|
+
e?.errorCallback(r);
|
|
55
54
|
}
|
|
56
55
|
window.close();
|
|
57
56
|
}
|
|
58
|
-
window.onload =
|
|
57
|
+
window.onload = g;
|