[VD]Fix account is not logined in automatically when relaunch 14/218214/5
authorVBS <chunling.ye@samsung.com>
Wed, 20 Nov 2019 08:23:40 +0000 (16:23 +0800)
committerVBS <chunling.ye@samsung.com>
Wed, 20 Nov 2019 10:41:22 +0000 (18:41 +0800)
Defect id: DF191018-00567
Issue: when relaunch app Watcha Play(3201612011352), app change to logout status.

Reason: the src of Watcha Play app is: https://erd2-play.watcha.net/tv
but not index.html. So url request which need the cookie is earlier than
valid cookie path been set.

Fix method: for tv product, set cookie path before loadURL.

Change-Id: I7351d1027c2c6efc90a8e2897aeef2e431b211a7
Signed-off-by: chunling.ye <chunling.ye@samsung.com>
wrt_app/src/runtime.js

index bb98db3..00b7274 100644 (file)
@@ -79,6 +79,8 @@ class Runtime {
         });
         app.on('web-contents-created', function(event, webContents) {
             console.log('web-contents-created');
+            if (_this.isTVProfile)
+                _this.setCookiePath();
             _this.webContents = webContents;
             _this.webContents.on('before-input-event', function(event, input) {
                 if (_this.isLaunched && _this.webApplication) {
@@ -179,7 +181,8 @@ class Runtime {
                     }
                 }
             }
-            _this.configureRuntime(appControl);
+            _this.setCookiePath();
+            _this.launchInspector(appControl);
         });
         wrt.on('suspend', function() {
             console.log('suspend');
@@ -306,22 +309,24 @@ class Runtime {
         let bundleDebug = (appControl.getData('__AUL_DEBUG__') === "1");
         return (bundleDebug || this.inspectorEnabledByVconf);
     }
-    launchInspector(appControl) {
-        var debugPort = wrt.startInspectorServer();
-        var data    = { "port" :  [ debugPort.toString() ] };
-        if (this.webApplication)
-            this.webApplication.debugPort = debugPort;
-        appControl.reply(data);
-    }
-    configureRuntime(appControl) {
-        this.configureRuntime = (param) => {}; // call once
+    setCookiePath() {
+        this.setCookiePath = () => {}; // call once
+        console.log('setCookiePath');
 
         // FIX ME : It must be supplemented to set a specific path
         wrt.setCookiePath();
+    }
+    launchInspector(appControl) {
+        this.launchInspector = (param) => {}; // call once
+        console.log('launchInspector');
 
         // AUL public key/Vconf - To support inspector
         if (this.checkInspectorCondition(appControl)) {
-            this.launchInspector(appControl);
+            var debugPort = wrt.startInspectorServer();
+            var data    = { "port" :  [ debugPort.toString() ] };
+            if (this.webApplication)
+                this.webApplication.debugPort = debugPort;
+            appControl.reply(data);
         }
     }
     handleKeyEvents(key) {