Fixed Mutiple AutoStart Call and Refresh Token
authorFulup Ar Foll <fulup@iot.bzh>
Fri, 12 Feb 2016 16:46:35 +0000 (17:46 +0100)
committerFulup Ar Foll <fulup@iot.bzh>
Fri, 12 Feb 2016 16:46:35 +0000 (17:46 +0100)
afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
afm-client/app/etc/AppDefaults.js

index a7ee13f..47c4410 100644 (file)
@@ -60,11 +60,11 @@ angular.module('TokenRefresh', ['AppConfig', 'ModalNotification'])
         };
         
         scope.onsuccess = function(data, errcode, headers, config) {
+            if (data.request.token) AppConfig.session.token = data.request.token;
+            if (data.request.uuid)  AppConfig.session.uuid  = data.request.uuid;
+            if (data.request.timeout)  AppConfig.session.timeout  = data.request.timeout;
+            
             if (scope.logged !== true)  {
-                if (data.request.token) AppConfig.session.token = data.request.token;
-                if (data.request.uuid)  AppConfig.session.uuid  = data.request.uuid;
-                if (data.request.timeout)  AppConfig.session.timeout  = data.request.timeout;
-
                 Notification.success ({message: "AppFramework Binder Back to Live", delay: 3000});
                 scope.online();
                 if (scope.callback) scope.callback();
index b0eb1a8..1825c45 100644 (file)
@@ -32,7 +32,7 @@ config = {
     UPLOAD_DIR: '/tmp/uploads',  // directory destination for uploaded files [/api/post/upload]
     
     // EXPRESS WEB server config [note: URLBASE generate rewriting rules]
-    EXPRESS_HOST    : 'localhost',         // HTTP will only listen on related Internet interface
+    EXPRESS_HOST    : '',         // HTTP will only listen on related Internet interface
     EXPRESS_PORT    : 4000,                // HTTP port
     EXPRESS_LOGDIR  : __dirname + '/../../log',  // httpd log file
     EXPRESS_SECRET  : Math.random().toString(36).slice(2), // [default cookie session]