@leapdev/auth-agent 2.4.5 → 2.5.1-beta.0
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/package.json +2 -2
- package/src/index.umd.js +12 -3
- package/src/lib/redirections.js +13 -3
- package/src/lib/types.d.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leapdev/auth-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1-beta.0",
|
|
4
4
|
"description": "LEAP Auth Agent",
|
|
5
5
|
"license": "LEAP Legal Software, PTY LTD",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"lodash": "^4.17.21",
|
|
10
10
|
"uuid": "^8.3.2",
|
|
11
|
-
"pubnub": "
|
|
11
|
+
"pubnub": "10.2.3",
|
|
12
12
|
"tslib": "^2.3.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {}
|
package/src/index.umd.js
CHANGED
|
@@ -6721,9 +6721,18 @@
|
|
|
6721
6721
|
let redirection;
|
|
6722
6722
|
let redirectUrl;
|
|
6723
6723
|
const topLevelDomains = redirectionConfig.topLevelDomains;
|
|
6724
|
-
const
|
|
6725
|
-
|
|
6726
|
-
|
|
6724
|
+
const topLevelDomainsV2 = redirectionConfig.topLevelDomains_v2;
|
|
6725
|
+
let suffix;
|
|
6726
|
+
let redirections = redirectionConfig.environments;
|
|
6727
|
+
let environmentVariables;
|
|
6728
|
+
suffix = topLevelDomainsV2.find(s => origin.endsWith(s));
|
|
6729
|
+
if (suffix) {
|
|
6730
|
+
redirections = redirectionConfig.environments_v2;
|
|
6731
|
+
environmentVariables = {};
|
|
6732
|
+
} else {
|
|
6733
|
+
suffix = topLevelDomains.find(s => origin.endsWith(s));
|
|
6734
|
+
environmentVariables = redirectionConfig.environmentVariables;
|
|
6735
|
+
}
|
|
6727
6736
|
if (suffix) {
|
|
6728
6737
|
for (let i = 0; i < redirections.length; i++) {
|
|
6729
6738
|
redirection = redirections[i];
|
package/src/lib/redirections.js
CHANGED
|
@@ -3,9 +3,19 @@ export const getRedirectUri = (origin, decodedToken, redirectionConfig) => {
|
|
|
3
3
|
let redirection;
|
|
4
4
|
let redirectUrl;
|
|
5
5
|
const topLevelDomains = redirectionConfig.topLevelDomains;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const topLevelDomainsV2 = redirectionConfig.topLevelDomains_v2;
|
|
7
|
+
let suffix;
|
|
8
|
+
let redirections = redirectionConfig.environments;
|
|
9
|
+
let environmentVariables;
|
|
10
|
+
suffix = topLevelDomainsV2.find((s) => origin.endsWith(s));
|
|
11
|
+
if (suffix) {
|
|
12
|
+
redirections = redirectionConfig.environments_v2;
|
|
13
|
+
environmentVariables = {};
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
suffix = topLevelDomains.find((s) => origin.endsWith(s));
|
|
17
|
+
environmentVariables = redirectionConfig.environmentVariables;
|
|
18
|
+
}
|
|
9
19
|
if (suffix) {
|
|
10
20
|
for (let i = 0; i < redirections.length; i++) {
|
|
11
21
|
redirection = redirections[i];
|
package/src/lib/types.d.ts
CHANGED
|
@@ -75,10 +75,22 @@ export declare type LeapToken = {
|
|
|
75
75
|
};
|
|
76
76
|
export declare type Redirections = {
|
|
77
77
|
topLevelDomains: Array<string>;
|
|
78
|
+
topLevelDomains_v2: Array<string>;
|
|
78
79
|
environments: Array<{
|
|
79
80
|
criteria: {
|
|
80
81
|
region: string;
|
|
81
82
|
environment: 'test' | 'live' | 'liveb';
|
|
83
|
+
countryCode: number;
|
|
84
|
+
};
|
|
85
|
+
topLevelDomain: string;
|
|
86
|
+
authHost: string;
|
|
87
|
+
applications: Array<string>;
|
|
88
|
+
}>;
|
|
89
|
+
environments_v2: Array<{
|
|
90
|
+
criteria: {
|
|
91
|
+
region: string;
|
|
92
|
+
environment: 'test' | 'live' | 'liveb';
|
|
93
|
+
countryCode: number;
|
|
82
94
|
};
|
|
83
95
|
topLevelDomain: string;
|
|
84
96
|
authHost: string;
|