From b9f387782bf9ea222d52eac954f1bddad8131391 Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Fri, 28 Aug 2015 11:52:59 -0400 Subject: Implemented auth key into the app so each image refresh in Montage and Monitor view does not hit the ZM DB and generate a million records. Solves the log pings of https://github.com/pliablepixels/zmNinja/issues/26 --- www/js/app.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'www/js/app.js') diff --git a/www/js/app.js b/www/js/app.js index bbcc50a8..20066d2d 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -370,6 +370,26 @@ angular.module('zmApp', [ d.reject("Login Error"); } + + // Now go ahead and re-get auth key + $rootScope.authSession="undefined"; + var ld = ZMDataModel.getLogin(); + ZMDataModel.getAuthKey() + .then(function(success) + { + + console.log (success); + $rootScope.authSession = success; + ZMDataModel.zmLog ("Stream authentication construction: " + + $rootScope.authSession); + + }, + function (error) + { + console.log (error); + //$rootScope.authSession=""; + ZMDataModel.zmLog ("Modal: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession); + }); return (d.promise); -- cgit v1.2.3