- scope.tkcreate = function() {
- var handler = $http.post(ConfigApp.session.create+'?token='+ ConfigApp.session.initial);
-
- // process success and error
- handler.success(scope.onsuccess);
- handler.error(scope.onerror);
- };
+ scope.loggin = function() {
+ AppCall.get (scope.plugin, "connect", {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);