summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-08-08 08:24:05 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-08-08 08:24:05 -0400
commitac159b6469107345fc313a70374b655e09f63522 (patch)
treed79c5101621b219fbc90dbf4290e0f6f65d2f206 /www/js/app.js
parentbb11e172f9d96334d093dc28638afdc0e817ac7b (diff)
making sure we re-authenticate when resuming from background
Diffstat (limited to 'www/js/app.js')
-rw-r--r--www/js/app.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 9a15b9f4..8737a3d0 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -288,7 +288,10 @@ angular.module('zmApp', [
//$timeout( function() {console.log ("***** ALL COOKIES:" + JSON.stringify( $browser.cookies()));},1000);
d.resolve("Login Success");
- console.log ("THIS IS WHERE I RETURN LOGIN SUCCESS DUDE");
+
+ $rootScope.$broadcast('event:auth-login-success', data);
+ $rootScope.rand = Math.floor((Math.random() * 100000) + 1);
+
return (d.promise);
})
@@ -299,6 +302,7 @@ angular.module('zmApp', [
console.log ("**** ZM Login FAILED");
ZMDataModel.zmLog ("zmAutologin Error " + JSON.stringify(error), "error");
d.resolve("Login Error");
+ $rootScope.$broadcast('event:auth-login-failed', error);
return d.promise;
});
return d.promise;
@@ -517,6 +521,7 @@ angular.module('zmApp', [
console.log("** generated Random of " + $rootScope.rand);
zmAutoLogin.stop(); //safety
zmAutoLogin.start();
+ zmAutoLogin.doLogin("authenticating ...");
}, false);