diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-30 10:55:59 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-30 10:55:59 -0400 |
| commit | f286615882223adf7bc309c75a142286b5044cc1 (patch) | |
| tree | 5fa006dcdcde6a223543d5cad4102993741b00a0 /www/js/DataModel.js | |
| parent | dee2ad4192126f82a7afbe1974b4470b0d0218af (diff) | |
#618 add token for basic auth as "fyi" for all images
Diffstat (limited to 'www/js/DataModel.js')
| -rwxr-xr-x | www/js/DataModel.js | 7 |
1 files changed, 5 insertions, 2 deletions
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); |
