From 95ad6e560b7ed9e578420362d527f29a7f3c1488 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Tue, 11 Feb 2020 12:05:18 -0500 Subject: #900 use token instead of auth if avaiable --- www/js/WizardCtrl.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 726cc6f4..c017b03f 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -583,8 +583,12 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ $ionicLoading.hide(); //$rootScope.loggedIntoZm = 1; $rootScope.authSession = ''; - - if (succ.credentials) { + if (succ.access_token) { + NVR.debug ('Got token, using it'); + $rootScope.authSession = "&token=" + succ.access_token; + } + else if (succ.credentials) { + NVR.debug ('Got auth= not token, using it'); $rootScope.authSession = "&" + succ.credentials; if (succ.append_password == '1') { $rootScope.authSession = $rootScope.authSession + -- cgit v1.2.3