@meshconnect/web-link-sdk 3.3.1 → 3.3.2

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/Link.js CHANGED
@@ -483,13 +483,18 @@ function handleErrorAndSendMessage(error, messageType) {
483
483
  }
484
484
  export var createLink = function (options) {
485
485
  var openLink = function (linkToken, customIframeId) {
486
- var _a;
486
+ var _a, _b;
487
487
  if (!linkToken) {
488
488
  (_a = options === null || options === void 0 ? void 0 : options.onExit) === null || _a === void 0 ? void 0 : _a.call(options, 'Invalid link token!');
489
489
  return;
490
490
  }
491
491
  currentOptions = options;
492
492
  var linkUrl = window.atob(linkToken);
493
+ var isProtocolValid = linkUrl.startsWith('http://') || linkUrl.startsWith('https://');
494
+ if (!isProtocolValid) {
495
+ (_b = options === null || options === void 0 ? void 0 : options.onExit) === null || _b === void 0 ? void 0 : _b.call(options, 'Invalid link token!');
496
+ return;
497
+ }
493
498
  linkUrl = addLanguage(linkUrl, currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.language);
494
499
  linkTokenOrigin = new URL(linkUrl).origin;
495
500
  window.removeEventListener('message', eventsListener);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshconnect/web-link-sdk",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "A client-side JS library for integrating with Mesh Connect",
5
5
  "exports": "./index.js",
6
6
  "license": "MIT",
@@ -1 +1 @@
1
- export declare const sdkVersion = "3.3.1";
1
+ export declare const sdkVersion = "3.3.2";
package/utils/version.js CHANGED
@@ -1 +1 @@
1
- export var sdkVersion = '3.3.1';
1
+ export var sdkVersion = '3.3.2';