From 576d9058a4afb2a179f8c6a338f9b6c08108822b Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Tue, 14 May 2019 13:33:00 -0400 Subject: initial support for tokens #817 --- www/js/WizardCtrl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index c1a2ca57..d5ca440f 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -83,7 +83,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function getFirstMonitor() { var d = $q.defer(); - $http.get($scope.wizard.apiURL + "/monitors.json") + $http.get($scope.wizard.apiURL + "/monitors.json?"+$rootScope.authSession) .then(function (success) { // console.log("getfirst monitor success: " + JSON.stringify(success)); if (success.data.monitors.length > 0) { @@ -202,7 +202,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ var urls = [a1, a2, a3, a4, a5]; // can't use getPathZms as loginData is not inited yet - $http.get($scope.wizard.apiURL + "/configs/viewByName/ZM_PATH_ZMS.json") + $http.get($scope.wizard.apiURL + "/configs/viewByName/ZM_PATH_ZMS.json?"+$rootScope.authSession) //NVR.getPathZms() // what does ZM have stored in PATH_ZMS? .then(function (data) { // remove zms or nph-zms @@ -321,7 +321,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ // lets try both /zm/api and /api. What else is there? var apilist = [api1, api2, api3]; - findFirstReachableUrl(apilist, '/host/getVersion.json') + findFirstReachableUrl(apilist, '/host/getVersion.json?'+$rootScope.authSession) .then(function (success) { NVR.log("Valid API response found with:" + success); $scope.wizard.apiURL = success; -- cgit v1.2.3 From 12c8516a9f8151f22588d4a0fb42530b85265c6f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 18 May 2019 13:29:28 -0400 Subject: #817 various intercept fixes --- www/js/WizardCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index d5ca440f..771f3f26 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -229,7 +229,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ getFirstMonitor() .then(function (success) { $ionicLoading.hide(); - var tail = "/nph-zms?mode=single&monitor=" + success; + var tail = "/nph-zms?mode=single&monitor=" + success + $rootScope.authSession; if ($scope.wizard.useauth && $scope.wizard.usezmauth) { var ck = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; -- cgit v1.2.3 From 5aee4039af90cc6b5c372076daa1d5ada9596075 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 20 May 2019 10:43:06 -0400 Subject: demote logs --- www/js/WizardCtrl.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 771f3f26..35f83641 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -470,7 +470,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ data = data.data; $ionicLoading.hide(); - console.log ("GOT "+data); + // console.log ("GOT "+data); if (data.indexOf(zm.loginScreenString1) >=0 || data.indexOf(zm.loginScreenString2) >=0 ) { @@ -578,7 +578,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ return d.promise; } NVR.debug("API based login returned... "); - console.log (JSON.stringify(succ)); + // console.log (JSON.stringify(succ)); $ionicLoading.hide(); //$rootScope.loggedIntoZm = 1; $rootScope.authSession = ''; @@ -635,13 +635,13 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ }, function (err) { - console.log("******************* API login error " + JSON.stringify(err)); + NVR.debug("******************* API login error " + JSON.stringify(err)); $ionicLoading.hide(); if (1) { //if (err && err.data && 'success' in err.data) { - console.log("API based login not supported, need to use web scraping..."); + NVR.log("API based login not supported, need to use web scraping..."); loginWebScrape(u,zmu,zmp) .then(function (succ) { @@ -678,6 +678,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function validateData() { + //console.log ("***** CLEARING AUTHSESSION IN VALIDATEDATA"); $rootScope.authSession = ''; $rootScope.zmCookie = ''; -- cgit v1.2.3 From 459682b60c024bd28fbaf83decb3b32c8555225e Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 25 May 2019 07:49:40 -0400 Subject: don't double add auth --- www/js/WizardCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 35f83641..86c4cbe9 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -229,7 +229,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ getFirstMonitor() .then(function (success) { $ionicLoading.hide(); - var tail = "/nph-zms?mode=single&monitor=" + success + $rootScope.authSession; + var tail = "/nph-zms?mode=single&monitor=" + success;//+ $rootScope.authSession; if ($scope.wizard.useauth && $scope.wizard.usezmauth) { var ck = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; -- cgit v1.2.3