Skip to content

Commit

Permalink
Change 'reutrn' to 'return' and fix lint issues (#310)
Browse files Browse the repository at this point in the history
* Change 'reutrn' to 'return' and fix lint issues

* Improved type checking
  • Loading branch information
cjchirag7 authored Apr 4, 2020
1 parent 20828ee commit 42b451c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,11 @@ EventHandle.prototype = {
}
};
function getUserType() {
let token_info = parseJwt(getCookie("token"));
if(token_info && token_info.userType) {
return token_info.userType;
let tokenInfo = parseJwt(getCookie('token'));
if (typeof tokenInfo==='object' && tokenInfo.userType) {
return tokenInfo.userType;
} else {
reutrn "Null";
return 'Null';
}
}
function getUserId() {
Expand Down

0 comments on commit 42b451c

Please sign in to comment.