From 5a81200bd99bd176a303d5ee05359d304fa499b8 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 11 Aug 2019 17:12:52 -0400 Subject: #842 - my code is a huge ness. --- www/js/LoginCtrl.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'www/js/LoginCtrl.js') diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 55d384e2..d4b6b601 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -817,6 +817,7 @@ function mobilePinConfig () { } + zmAutoLogin.doLogin("") // Do the happy menu only if authentication works // if it does not work, there is an emitter for auth @@ -834,13 +835,15 @@ function mobilePinConfig () { if ($scope.loginData.serverName != NVR.getLogin().serverName) { NVR.debug(">>> Server information has changed, likely a fallback took over!"); $scope.loginData = NVR.getLogin(); - apiurl = $scope.loginData.apiurl + '/host/getVersion.json?'+$rootScope.authSession; + portalurl = $scope.loginData.url + '/index.php'; } // possible image digits changed between servers NVR.getKeyConfigParams(0); - + console.log ('In loginCtrl, token is '+$rootScope.authSession) + apiurl = $scope.loginData.apiurl + '/host/getVersion.json?'+$rootScope.authSession; + NVR.log("Validating APIs at " + apiurl); $http.get(apiurl) .then(function (data) { @@ -879,6 +882,11 @@ function mobilePinConfig () { }, function (error) { + + if ($rootScope.userCancelledAuth) { + return; + } + NVR.displayBanner('error', [$translate.instant('kBannerAPICheckFailed'), $translate.instant('kBannerPleaseCheck')]); NVR.log("API login error " + JSON.stringify(error)); -- cgit v1.2.3 From f11b5e9416d808ce92480c164dce389e233609df Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 12 Aug 2019 11:43:07 -0400 Subject: test --- www/js/LoginCtrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'www/js/LoginCtrl.js') diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index d4b6b601..cd6861a8 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -841,7 +841,7 @@ function mobilePinConfig () { // possible image digits changed between servers NVR.getKeyConfigParams(0); - console.log ('In loginCtrl, token is '+$rootScope.authSession) + console.log ('In loginCtrl, token is '+$rootScope.authSession); apiurl = $scope.loginData.apiurl + '/host/getVersion.json?'+$rootScope.authSession; NVR.log("Validating APIs at " + apiurl); @@ -886,7 +886,7 @@ function mobilePinConfig () { if ($rootScope.userCancelledAuth) { return; } - + NVR.displayBanner('error', [$translate.instant('kBannerAPICheckFailed'), $translate.instant('kBannerPleaseCheck')]); NVR.log("API login error " + JSON.stringify(error)); -- cgit v1.2.3