Преглед изворни кода

Merge pull request #11498 from GordonSmith/HPCC-20178

HPCC-20178 Partially revert HPCC-19912

Reviewed-By: Miguel Vazquez <miguel.vazquez@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman пре 6 година
родитељ
комит
bdc908a91a
1 измењених фајлова са 13 додато и 13 уклоњено
  1. 13 13
      esp/src/stub.htm

+ 13 - 13
esp/src/stub.htm

@@ -35,26 +35,26 @@
             document.write("<script type=\"text/javascript\" src=\"/esp/files/dist/stub.eclwatch.js\" charset=\"utf-8\"><" + "/script>");
         }
         getAuthType();
-        function getAuthType() {
-            if (document.cookie.indexOf("ESPSessionState=true") > -1) {
+        function getAuthType(){
+            if (document.cookie.indexOf ("ESPSessionState=true") > -1){
                 checkCookie();
-            } else if (document.cookie.indexOf("ESPSessionState=false") > -1) {
-                // window.location();
+            } else if (document.cookie.indexOf ("ESPSessionState=false") > -1) {
+                window.location();
             } else {
                 sendAuthRequest();
             }
 
-            function checkCookie() {
-                document.cookie.indexOf("ESPAuthenticated=true") > -1 ? window.location.href : window.location = location.origin + "/esp/files/Login.html";
-            }
+            function checkCookie(){
+                    document.cookie.indexOf ("ESPAuthenticated=true") > -1 ? window.location.href : window.location = location.origin + "/esp/files/Login.html";
+                }
 
-            function sendAuthRequest() {
+            function sendAuthRequest(){
                 var xhttp = new XMLHttpRequest();
-                xhttp.open('GET', 'esp/getauthtype', true);
+                xhttp.open ('GET', 'esp/getauthtype', true);
                 xhttp.send();
-                xhttp.onload = function () {
+                xhttp.onload = function(){
                     var responseType = (this.responseXML.childNodes[0].textContent);
-                    if (this.readyState == 4 && this.status == 200 && this.responseXML.childNodes[0].textContent == responseType) {
+                    if (this.readyState == 4 && this.status == 200 && this.responseXML.childNodes[0].textContent == responseType){
                         switch (responseType) {
                             case 'Mixed':
                             case 'PerSessionOnly':
@@ -67,9 +67,9 @@
                                 break;
                             default:
                                 document.cookie = ("ESPSessionState=false");
-                        }
+                            }
                     } else {
-                        alert('Authorization Request Error.')
+                        alert ('Authorization Request Error.')
                     }
                 }
             }