Fix authentication
[vchess.git] / client / src / utils / ajax.js
index 0a50a10..1d181fa 100644 (file)
@@ -47,9 +47,8 @@ export function ajax(url, method, data, success, error)
        }
        xhr.open(method, params.serverUrl + url, true);
        xhr.setRequestHeader('X-Requested-With', "XMLHttpRequest");
-       // Next line because logout and authenticate set (cross-domain in dev mode) cookies
-  if (url.startsWith("/authenticate") || url.startsWith("/logout"))
-    xhr.withCredentials = true;
+       // Next line to allow cross-domain cookies in dev mode (TODO: if...)
+  xhr.withCredentials = true;
   if (["POST","PUT"].includes(method))
        {
                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");