Przeglądaj źródła

Update login.system

AY 4 lat temu
rodzic
commit
2450f93be5
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      web/login.system

+ 8 - 2
web/login.system

@@ -189,12 +189,18 @@
                 if(data.auto_redirect == true) {
                     //checking if they come from desktop.system or mobile.system
                     //if they come from that two pages, usually mean they are just logged out.
-                    if(document.referrer != window.location.origin + "/desktop.system" && document.referrer != window.location.origin + "/mobile.system"){
+                    if(document.referrer != ''){
+                        var path = new URL(document.referrer);
+                    } else {
+                        var path = new URL('http://0.0.0.0');
+
+                    }
+                    if(document.referrer != window.location.origin + "/desktop.system" && document.referrer != window.location.origin + "/mobile.system" && path.origin + path.pathname !=  window.location.origin + "/system/auth/oauth/authorize"){
                         $(".ts.borderless.basic.segment").attr("style","display: none;");
                         $(".ts.borderless.basic.segment").attr("id","aoLogin");
                         $(".ts.borderless.basic.segment").after('<div id="autoRedirectSegment" class="ts borderless basic segment"><p><i class="key icon"></i>Redirecting to your organization sign in page...</p><br><a style="cursor: pointer;" onclick="stopAutoRedirect()">Cancel</a></div>');
                         autoRedirectTimer = setTimeout(function(){
-                        window.location.href = "system/auth/oauth/login?redirect=" + redirectionAddress;
+                            window.location.href = "system/auth/oauth/login?redirect=" + redirectionAddress;
                         }, 3000);
                     }
                 }