@leapdev/auth-agent 2.5.2 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapdev/auth-agent",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "LEAP Auth Agent",
5
5
  "license": "LEAP Legal Software, PTY LTD",
6
6
  "main": "./src/index.js",
package/src/index.umd.js CHANGED
@@ -6742,12 +6742,12 @@
6742
6742
  let suffix;
6743
6743
  let redirections = redirectionConfig.environments;
6744
6744
  let environmentVariables;
6745
- suffix = topLevelDomainsV2.find(s => origin.endsWith(s));
6745
+ suffix = topLevelDomainsV2 && topLevelDomainsV2.length > 0 ? topLevelDomainsV2.find(s => origin.endsWith(s)) : undefined;
6746
6746
  if (suffix) {
6747
6747
  redirections = redirectionConfig.environments_v2;
6748
6748
  environmentVariables = {};
6749
6749
  } else {
6750
- suffix = topLevelDomains.find(s => origin.endsWith(s));
6750
+ suffix = topLevelDomains && topLevelDomains.length > 0 ? topLevelDomains.find(s => origin.endsWith(s)) : undefined;
6751
6751
  environmentVariables = redirectionConfig.environmentVariables;
6752
6752
  }
6753
6753
  if (suffix) {
@@ -7,13 +7,13 @@ export const getRedirectUri = (origin, decodedToken, redirectionConfig) => {
7
7
  let suffix;
8
8
  let redirections = redirectionConfig.environments;
9
9
  let environmentVariables;
10
- suffix = topLevelDomainsV2.find((s) => origin.endsWith(s));
10
+ suffix = topLevelDomainsV2 && topLevelDomainsV2.length > 0 ? topLevelDomainsV2.find((s) => origin.endsWith(s)) : undefined;
11
11
  if (suffix) {
12
12
  redirections = redirectionConfig.environments_v2;
13
13
  environmentVariables = {};
14
14
  }
15
15
  else {
16
- suffix = topLevelDomains.find((s) => origin.endsWith(s));
16
+ suffix = topLevelDomains && topLevelDomains.length > 0 ? topLevelDomains.find((s) => origin.endsWith(s)) : undefined;
17
17
  environmentVariables = redirectionConfig.environmentVariables;
18
18
  }
19
19
  if (suffix) {