@axa-fr/react-oidc 5.14.0 → 6.0.0-alpha0
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/OidcProvider.d.ts +1 -0
- package/dist/OidcProvider.d.ts.map +1 -1
- package/dist/OidcProvider.js +13 -5
- package/dist/OidcProvider.js.map +1 -1
- package/dist/OidcServiceWorker.js +13 -0
- package/dist/ReactOidc.d.ts.map +1 -1
- package/dist/ReactOidc.js +29 -7
- package/dist/ReactOidc.js.map +1 -1
- package/dist/core/default-component/ServiceWorkerInstall.component.d.ts.map +1 -1
- package/dist/core/default-component/ServiceWorkerInstall.component.js +21 -9
- package/dist/core/default-component/ServiceWorkerInstall.component.js.map +1 -1
- package/dist/core/default-component/SilentCallback.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentCallback.component.js +23 -15
- package/dist/core/default-component/SilentCallback.component.js.map +1 -1
- package/dist/core/default-component/SilentSignin.component.d.ts +4 -0
- package/dist/core/default-component/SilentSignin.component.d.ts.map +1 -0
- package/dist/core/default-component/SilentSignin.component.js +58 -0
- package/dist/core/default-component/SilentSignin.component.js.map +1 -0
- package/dist/core/routes/OidcRoutes.d.ts +1 -0
- package/dist/core/routes/OidcRoutes.d.ts.map +1 -1
- package/dist/core/routes/OidcRoutes.js +8 -2
- package/dist/core/routes/OidcRoutes.js.map +1 -1
- package/dist/vanilla/checkSessionIFrame.d.ts +17 -0
- package/dist/vanilla/checkSessionIFrame.d.ts.map +1 -0
- package/dist/vanilla/checkSessionIFrame.js +78 -0
- package/dist/vanilla/checkSessionIFrame.js.map +1 -0
- package/dist/vanilla/initSession.d.ts +3 -1
- package/dist/vanilla/initSession.d.ts.map +1 -1
- package/dist/vanilla/initSession.js +20 -11
- package/dist/vanilla/initSession.js.map +1 -1
- package/dist/vanilla/initWorker.d.ts +4 -0
- package/dist/vanilla/initWorker.d.ts.map +1 -1
- package/dist/vanilla/initWorker.js +31 -3
- package/dist/vanilla/initWorker.js.map +1 -1
- package/dist/vanilla/oidc.d.ts +24 -5
- package/dist/vanilla/oidc.d.ts.map +1 -1
- package/dist/vanilla/oidc.js +504 -224
- package/dist/vanilla/oidc.js.map +1 -1
- package/dist/vanilla/route-utils.d.ts +13 -0
- package/dist/vanilla/route-utils.d.ts.map +1 -0
- package/dist/vanilla/route-utils.js +65 -0
- package/dist/vanilla/route-utils.js.map +1 -0
- package/package.json +1 -1
- package/src/App.tsx +1 -1
- package/src/configurations.ts +8 -4
- package/src/oidc/OidcProvider.tsx +11 -0
- package/src/oidc/ReactOidc.tsx +32 -8
- package/src/oidc/core/default-component/ServiceWorkerInstall.component.tsx +15 -3
- package/src/oidc/core/default-component/SilentCallback.component.tsx +10 -15
- package/src/oidc/core/default-component/SilentSignin.component.tsx +35 -0
- package/src/oidc/core/routes/OidcRoutes.tsx +10 -1
- package/src/oidc/vanilla/OidcServiceWorker.js +13 -0
- package/src/oidc/vanilla/checkSessionIFrame.ts +82 -0
- package/src/oidc/vanilla/initSession.ts +23 -11
- package/src/oidc/vanilla/initWorker.ts +19 -2
- package/src/oidc/vanilla/oidc.ts +400 -137
- package/src/oidc/{core/routes → vanilla}/route-utils.spec.ts +0 -0
- package/src/oidc/vanilla/route-utils.ts +76 -0
- package/dist/core/routes/route-utils.d.ts +0 -2
- package/dist/core/routes/route-utils.d.ts.map +0 -1
- package/dist/core/routes/route-utils.js +0 -32
- package/dist/core/routes/route-utils.js.map +0 -1
- package/src/oidc/core/routes/route-utils.ts +0 -34
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const getLocation = (href: string) => {
|
|
2
|
+
const match = href.match(
|
|
3
|
+
// eslint-disable-next-line no-useless-escape
|
|
4
|
+
/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
let search = match[6];
|
|
8
|
+
let hash = match[7];
|
|
9
|
+
|
|
10
|
+
if (hash) {
|
|
11
|
+
const splits = hash.split("?");
|
|
12
|
+
if(splits.length ==2){
|
|
13
|
+
hash = splits[0];
|
|
14
|
+
search = splits[1];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if(search){
|
|
19
|
+
search = search.slice(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
match && {
|
|
24
|
+
href,
|
|
25
|
+
protocol: match[1],
|
|
26
|
+
host: match[2],
|
|
27
|
+
hostname: match[3],
|
|
28
|
+
port: match[4],
|
|
29
|
+
path: match[5],
|
|
30
|
+
search,
|
|
31
|
+
hash,
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const getPath = (href: string) => {
|
|
37
|
+
const location = getLocation(href);
|
|
38
|
+
let { path } = location;
|
|
39
|
+
|
|
40
|
+
if(path.endsWith('/')){
|
|
41
|
+
path = path.slice(0, -1);
|
|
42
|
+
}
|
|
43
|
+
let { hash } = location;
|
|
44
|
+
|
|
45
|
+
if(hash === "#_=_"){
|
|
46
|
+
hash = "";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (hash) {
|
|
50
|
+
path += hash;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return path;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const getParseQueryStringFromLocation=(href: string) => {
|
|
57
|
+
const location = getLocation(href);
|
|
58
|
+
let { search } = location;
|
|
59
|
+
|
|
60
|
+
return parseQueryString(search);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const parseQueryString = (queryString:string) => {
|
|
64
|
+
let params:any = {}, queries, temp, i, l;
|
|
65
|
+
|
|
66
|
+
// Split into key/value pairs
|
|
67
|
+
queries = queryString.split("&");
|
|
68
|
+
|
|
69
|
+
// Convert the array of strings into an object
|
|
70
|
+
for (i = 0, l = queries.length; i < l; i++) {
|
|
71
|
+
temp = queries[i].split('=');
|
|
72
|
+
params[temp[0]] = temp[1];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return params;
|
|
76
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-utils.d.ts","sourceRoot":"","sources":["../../../src/oidc/core/routes/route-utils.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,OAAO,SAAU,MAAM,WAcnC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPath = void 0;
|
|
4
|
-
var getLocation = function (href) {
|
|
5
|
-
var match = href.match(
|
|
6
|
-
// eslint-disable-next-line no-useless-escape
|
|
7
|
-
/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);
|
|
8
|
-
return (match && {
|
|
9
|
-
href: href,
|
|
10
|
-
protocol: match[1],
|
|
11
|
-
host: match[2],
|
|
12
|
-
hostname: match[3],
|
|
13
|
-
port: match[4],
|
|
14
|
-
path: match[5],
|
|
15
|
-
search: match[6],
|
|
16
|
-
hash: match[7],
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
var getPath = function (href) {
|
|
20
|
-
var location = getLocation(href);
|
|
21
|
-
var path = location.path;
|
|
22
|
-
if (path.endsWith('/')) {
|
|
23
|
-
path = path.slice(0, -1);
|
|
24
|
-
}
|
|
25
|
-
var hash = location.hash;
|
|
26
|
-
if (hash) {
|
|
27
|
-
path += hash.split("?")[0];
|
|
28
|
-
}
|
|
29
|
-
return path;
|
|
30
|
-
};
|
|
31
|
-
exports.getPath = getPath;
|
|
32
|
-
//# sourceMappingURL=route-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-utils.js","sourceRoot":"","sources":["../../../src/oidc/core/routes/route-utils.ts"],"names":[],"mappings":";;;AAAA,IAAM,WAAW,GAAG,UAAC,IAAY;IAC/B,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK;IACtB,6CAA6C;IAC7C,+EAA+E,CAChF,CAAC;IACF,OAAO,CACL,KAAK,IAAI;QACP,IAAI,MAAA;QACJ,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAClB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAClB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAChB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACf,CACF,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,OAAO,GAAG,UAAC,IAAY;IAClC,IAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAA,IAAI,GAAK,QAAQ,KAAb,CAAc;IAExB,IAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;QAClB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC5B;IACO,IAAA,IAAI,GAAK,QAAQ,KAAb,CAAc;IAE1B,IAAI,IAAI,EAAE;QACR,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5B;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAdW,QAAA,OAAO,WAclB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const getLocation = (href: string) => {
|
|
2
|
-
const match = href.match(
|
|
3
|
-
// eslint-disable-next-line no-useless-escape
|
|
4
|
-
/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/
|
|
5
|
-
);
|
|
6
|
-
return (
|
|
7
|
-
match && {
|
|
8
|
-
href,
|
|
9
|
-
protocol: match[1],
|
|
10
|
-
host: match[2],
|
|
11
|
-
hostname: match[3],
|
|
12
|
-
port: match[4],
|
|
13
|
-
path: match[5],
|
|
14
|
-
search: match[6],
|
|
15
|
-
hash: match[7],
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const getPath = (href: string) => {
|
|
21
|
-
const location = getLocation(href);
|
|
22
|
-
let { path } = location;
|
|
23
|
-
|
|
24
|
-
if(path.endsWith('/')){
|
|
25
|
-
path = path.slice(0, -1);
|
|
26
|
-
}
|
|
27
|
-
const { hash } = location;
|
|
28
|
-
|
|
29
|
-
if (hash) {
|
|
30
|
-
path += hash.split("?")[0];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return path;
|
|
34
|
-
};
|