diff --git a/frontend/src/assets/helpers.js b/frontend/src/assets/helpers.js index ee196cd..e79c35a 100644 --- a/frontend/src/assets/helpers.js +++ b/frontend/src/assets/helpers.js @@ -5,9 +5,10 @@ function request(method, path, data = null) { if (xhr.status >= 200 && xhr.status < 300) resolve(xhr.responseText ? JSON.parse(xhr.responseText) : null); else - reject(xhr.responseText ? JSON.parse(xhr.responseText).title : "HTTP " + xhr.status); + reject(xhr.responseText || "HTTP " + xhr.status); } xhr.onerror = () => reject("Something went wrong"); + xhr.withCredentials = true; xhr.open(method, import.meta.env.VITE_API_URL + path); if (data) xhr.setRequestHeader("Content-Type", "application/json"), xhr.send(JSON.stringify(data)); diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue index ffcfccc..17f2518 100644 --- a/frontend/src/views/LoginView.vue +++ b/frontend/src/views/LoginView.vue @@ -1,17 +1,43 @@ diff --git a/frontend/src/views/RegisterView.vue b/frontend/src/views/RegisterView.vue index 0888957..07b28f7 100644 --- a/frontend/src/views/RegisterView.vue +++ b/frontend/src/views/RegisterView.vue @@ -26,14 +26,14 @@ function success() {

{{ error }}