summaryrefslogtreecommitdiff
path: root/www/js/LoginCtrl.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/LoginCtrl.js')
-rw-r--r--www/js/LoginCtrl.js12
1 files changed, 10 insertions, 2 deletions
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("<button class='button button-clear' style='line-height: normal; min-height: 0; min-width: 0; color:#fff;' ng-click='$root.cancelAuth()'><i class='ion-close-circled'></i>&nbsp;" + $translate.instant('kAuthenticating') + "...</button>")
// 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));