From e3ce964ae1cae5a93f5c078c8d002cf8e86e4258 Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Sun, 22 Dec 2024 00:06:28 +0100 Subject: [PATCH] Added cookieManager.js --- helpapp-frontend/index.html | 1 + helpapp-frontend/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helpapp-frontend/index.html b/helpapp-frontend/index.html index 50e0915..07f1d96 100644 --- a/helpapp-frontend/index.html +++ b/helpapp-frontend/index.html @@ -5,6 +5,7 @@ + HelpApp diff --git a/helpapp-frontend/index.js b/helpapp-frontend/index.js index 2cdc2ee..21d76dd 100644 --- a/helpapp-frontend/index.js +++ b/helpapp-frontend/index.js @@ -13,6 +13,9 @@ function roleDefine() { document.addEventListener("DOMContentLoaded", () => { roleDefine(); + // setCookie("toto",12,1); + // console.log(checkCookie("toto")); + // console.log(getCookie("toto")); const loginForm = document.getElementById("login-form"); const loginResponse = document.getElementById("login-response"); @@ -32,7 +35,7 @@ document.addEventListener("DOMContentLoaded", () => { const password = document.getElementById("login-password").value; try { - const response = await fetch(`${API_BASE}:8083/users/authenticate`, { + const response = await fetch(`${API_BASE}:${USER_PORT}/users/authenticate`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email, password }), @@ -59,7 +62,7 @@ document.addEventListener("DOMContentLoaded", () => { const role = document.getElementById("role").value; try { - const response = await fetch(`${API_BASE}:8083/users`, { + const response = await fetch(`${API_BASE}:${USER_PORT}/users`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name, email, password, role }),