make redirect URI also work if index.html is called specifically
[lantea.git] / js / ui.js
index a419962fc47310238dd317d14ea4d5a4371fce42..02e294735001bdd228469e4bdd450f137d60b7d4 100644 (file)
--- a/js/ui.js
+++ b/js/ui.js
@@ -135,7 +135,7 @@ function startLogin() {
 }
 
 function getRedirectURI() {
-  return window.location.protocol + '//' + window.location.host + window.location.pathname + "login.html";
+  return window.location.protocol + '//' + window.location.host + window.location.pathname.replace("index.html", "") + "login.html";
 }
 
 function doLogout() {
@@ -760,6 +760,7 @@ function fetchBackend(aEndpoint, aMethod, aSendData, aCallback, aCallbackForward
     }
   };
   XHR.open(aMethod, gBackendURL + aEndpoint, true);
+  XHR.withCredentials = "true";
   //XHR.setRequestHeader("Accept", "application/json");
   try {
     XHR.send(aSendData); // Send actual form data.