From 63e90783c3800da13fa7606b50ebfca7c1b86c4d Mon Sep 17 00:00:00 2001 From: Radek Pazdera Date: Wed, 22 Mar 2017 12:49:33 +0000 Subject: [PATCH] bugfix: Make sure the initSession callback isn't called 2x --- dist/kano-world-sdk.js | 2 +- lib/core/auth.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/kano-world-sdk.js b/dist/kano-world-sdk.js index f37776b..cdccbfa 100644 --- a/dist/kano-world-sdk.js +++ b/dist/kano-world-sdk.js @@ -134,7 +134,7 @@ module.exports = function (config) { // The current website is either KW or running inside Electron, we read directly the locaStorage if (isKW || isElectron) { - p = onToken(token || localStorage.getItem('KW_TOKEN')); + return onToken(token || localStorage.getItem('KW_TOKEN')); } // Otherwise, contact KW to get the toekn throught the iframe xdAuth.getCrossToken(function (err, tk) { diff --git a/lib/core/auth.js b/lib/core/auth.js index c33c9cd..055d966 100644 --- a/lib/core/auth.js +++ b/lib/core/auth.js @@ -72,7 +72,7 @@ module.exports = function (config) { // The current website is either KW or running inside Electron, we read directly the locaStorage if (isKW || isElectron) { - p = onToken(token || localStorage.getItem('KW_TOKEN')); + return onToken(token || localStorage.getItem('KW_TOKEN')); } // Otherwise, contact KW to get the toekn throught the iframe xdAuth.getCrossToken(function (err, tk) { diff --git a/package.json b/package.json index f5ad820..b224e8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kano-world-sdk", - "version": "3.0.15", + "version": "3.0.16", "description": "Kano World SDK", "main": "lib/index.js", "scripts": {