From 2b654fb61c54f308b1754423823a5adad58db1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Robles?= Date: Thu, 5 Sep 2024 17:37:37 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Login=20error=20for=20voters=20(?= =?UTF-8?q?#409)=20(#411)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parent issue: https://github.com/sequentech/meta/issues/1832 --- avRegistration/auth-method-service.js | 4 +++- dist/appCommon-vmaster.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) 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);