- scope.tkcreate = function() {
-
- AppCall.get ("token", "create", {token: AppConfig.session.initial},function(jresp, errcode) {
- if (errcode) scope.onerror();
- else scope.onsuccess (jresp);
- });
- };
+ scope.loggin = function() {
+ AppCall.get ("token", "create", {token: AppConfig.session.initial}, function(jresp, errcode) {
+
+ if (!scope.onsuccess (jresp, errcode)) return;
+
+ // Intial token was accepted let's start ping & refresh
+ $timeout (scope.getping, AppConfig.session.pingrate*1000);
+ $timeout (scope.refresh, AppConfig.session.timeout *250);