From f286615882223adf7bc309c75a142286b5044cc1 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 30 Apr 2018 10:55:59 -0400 Subject: #618 add token for basic auth as "fyi" for all images --- www/js/DataModel.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 38fd95d5..455e4c0a 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -882,6 +882,7 @@ angular.module('zmApp.controllers') loginData.basicAuthUser = ''; loginData.basicAuthPassword = ''; $rootScope.basicAuthHeader=''; + $rootScope.basicAuthToken=''; } if (loginData.url.indexOf('@') != -1) { @@ -905,7 +906,8 @@ angular.module('zmApp.controllers') if (components.port) loginData.apiurl = loginData.apiurl + ":" + components.port; if (components.path) loginData.apiurl = loginData.apiurl + components.path; - $rootScope.basicAuthHeader = 'Basic ' + btoa(components.userinfo); + $rootScope.basicAuthToken = btoa(components.userinfo); + $rootScope.basicAuthHeader = 'Basic ' + $rootScope.basicAuthToken; //console.log (">>>> SET BASIC AUTH TO " + $rootScope.basicAuthHeader); var up = components.userinfo.split(':'); @@ -916,7 +918,8 @@ angular.module('zmApp.controllers') } if (loginData.isUseBasicAuth) { - $rootScope.basicAuthHeader = 'Basic ' + btoa(loginData.basicAuthUser+':'+loginData.basicAuthPassword); + $rootScope.basicAuthToken = btoa(loginData.basicAuthUser+':'+loginData.basicAuthPassword); + $rootScope.basicAuthHeader = 'Basic ' + $rootScope.basicAuthToken; debug ("Basic authentication detected, constructing Authorization Header"); // console.log ("BASIC AUTH SET TO:"+$rootScope.basicAuthHeader); -- cgit v1.2.3