diff --git a/avRegistration/auth-method-service.js b/avRegistration/auth-method-service.js index cbf106f3..21924fd8 100644 --- a/avRegistration/auth-method-service.js +++ b/avRegistration/auth-method-service.js @@ -107,7 +107,9 @@ angular.module('avRegistration') var tokens = []; if (credentialsStr) { var credentials = JSON.parse(credentialsStr); - tokens = credentials.map(function (credential) { return credential.token; }); + tokens = credentials + .map(function (credential) { return credential.token; }) + .filter(function (token) { return !!token;}); return tokens; } if (isAdmin && $http.defaults.headers.common.Authorization) { diff --git a/dist/appCommon-vmaster.js b/dist/appCommon-vmaster.js index ba3dd8ca..acdb5aac 100644 --- a/dist/appCommon-vmaster.js +++ b/dist/appCommon-vmaster.js @@ -10,6 +10,8 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist var credentialsStr = $window.sessionStorage.getItem("vote_permission_tokens"), tokens = []; return credentialsStr ? JSON.parse(credentialsStr).map(function(credential) { return credential.token; + }).filter(function(token) { + return !!token; }) : (isAdmin && $http.defaults.headers.common.Authorization && tokens.push($http.defaults.headers.common.Authorization), tokens); }(halfLifes);