summaryrefslogtreecommitdiff
path: root/www/js/PortalLoginCtrl.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-08-11 15:47:11 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-08-11 15:47:11 -0400
commita09333e8b97a5f5c71331ce18777889510aed302 (patch)
tree9f6b69e4996088ee13004c3bee6ea9d5f57e89db /www/js/PortalLoginCtrl.js
parent68af457b04b26e26f0414b821dabe7359e18a0ad (diff)
API auth tied into ZM auth, enabled client to work in both auth and non-auth mode honoring ZM's auth system
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
-rw-r--r--www/js/PortalLoginCtrl.js15
1 files changed, 12 insertions, 3 deletions
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
{