From 84f34964077913e306ef0c23a8a921748bc13b66 Mon Sep 17 00:00:00 2001 From: Chirag Jain Date: Sat, 4 Apr 2020 11:26:16 +0530 Subject: [PATCH] Improved type checking --- common/util.js | 2 +- test/config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/util.js b/common/util.js index 2ede386b6..9d002f8c3 100644 --- a/common/util.js +++ b/common/util.js @@ -787,7 +787,7 @@ EventHandle.prototype = { }; function getUserType() { let tokenInfo = parseJwt(getCookie('token')); - if (tokenInfo && tokenInfo.userType) { + if (typeof tokenInfo==='object' && tokenInfo.userType) { return tokenInfo.userType; } else { return 'Null'; diff --git a/test/config.js b/test/config.js index 6409dc8cc..5d7269885 100644 --- a/test/config.js +++ b/test/config.js @@ -1,7 +1,7 @@ //config.js // -//global.origin = 'http://localhost:4010' -global.origin = 'http://127.0.0.1:8080' +global.origin = 'http://localhost:4010' +// global.origin = 'http://127.0.0.1:8080' global.testFolder = '/test'