diff --git a/luciexpress/htdocs/js/app.js b/luciexpress/htdocs/js/app.js index 426f3d79e..bf4e315b7 100644 --- a/luciexpress/htdocs/js/app.js +++ b/luciexpress/htdocs/js/app.js @@ -125,6 +125,8 @@ JUCI.app.config(function ($stateProvider, $locationProvider, $compileProvider, $ } }, // Perfect! This loads our controllers on demand! :) + // Leave this code here because it serves as a valuable example + // of how this can be done. /*resolve: { deps : function ($q, $rootScope) { var deferred = $q.defer(); @@ -139,7 +141,14 @@ JUCI.app.config(function ($stateProvider, $locationProvider, $compileProvider, $ },*/ onEnter: function($uci, $rootScope){ $rootScope.errors.splice(0, $rootScope.errors.length); - $uci.$revert(); + + // this will touch the session so that it does not expire + $rpc.$authenticate().done(function(){ + $uci.$revert(); + }).fail(function(){ + $juci.redirect("login"); + }); + document.title = $tr(k.replace(/\//g, ".")+".title")+" - "+$tr(gettext("application.name")); }, onExit: function($interval){ diff --git a/luciexpress/htdocs/js/rpc.js b/luciexpress/htdocs/js/rpc.js index 900aff129..07fa668a7 100644 --- a/luciexpress/htdocs/js/rpc.js +++ b/luciexpress/htdocs/js/rpc.js @@ -158,7 +158,7 @@ } else { self.$session = result; if(!("data" in self.$session)) self.$session.data = {}; - console.log("Session: Loggedin! "); + //console.log("Session: Loggedin! "); deferred.resolve(result); } }).fail(function err(result){