From a09333e8b97a5f5c71331ce18777889510aed302 Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Tue, 11 Aug 2015 15:47:11 -0400 Subject: API auth tied into ZM auth, enabled client to work in both auth and non-auth mode honoring ZM's auth system --- www/js/PortalLoginCtrl.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'www/js/PortalLoginCtrl.js') diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index ae75d197..422c18ab 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -18,12 +18,21 @@ console.log ("***** INSIDE LOGIN CONTROLLER"); if (ZMDataModel.isLoggedIn()) { ZMDataModel.zmLog ("User credentials are provided"); // console.log("VALID CREDENTIALS. Grabbing Monitors"); - zmAutoLogin.doLogin("Logging into ZoneMinder...") - .then (function(data) + zmAutoLogin.doLogin("authenticating...") + .then (function(data) // success { ZMDataModel.getKeyConfigParams(1); $state.go('montage'); - }); + }, + // coming here means auth error + // so go back to login + function (error) + { + $state.go('login'); + } + + + ); } else { -- cgit v1.2.3