mirror of
https://github.com/Lemonochrme/service-architecture.git
synced 2025-06-08 21:50:50 +02:00
Added cookieManager.js
This commit is contained in:
parent
34938cba02
commit
e3ce964ae1
2 changed files with 6 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script> <!-- Include HTMX -->
|
<script src="https://unpkg.com/htmx.org@1.9.12"></script> <!-- Include HTMX -->
|
||||||
|
<script src="https://gigabyte5671.github.io/CookieManager/cookieManager.min.js" type="text/javascript"></script> <!-- Include CookieManager -->
|
||||||
<script src="base.js"></script> <!-- Include BASE -->
|
<script src="base.js"></script> <!-- Include BASE -->
|
||||||
<script src="generated.js"></script> <!-- Include GENERATED -->
|
<script src="generated.js"></script> <!-- Include GENERATED -->
|
||||||
<title>HelpApp</title>
|
<title>HelpApp</title>
|
||||||
|
|
|
@ -13,6 +13,9 @@ function roleDefine() {
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
roleDefine();
|
roleDefine();
|
||||||
|
// setCookie("toto",12,1);
|
||||||
|
// console.log(checkCookie("toto"));
|
||||||
|
// console.log(getCookie("toto"));
|
||||||
|
|
||||||
const loginForm = document.getElementById("login-form");
|
const loginForm = document.getElementById("login-form");
|
||||||
const loginResponse = document.getElementById("login-response");
|
const loginResponse = document.getElementById("login-response");
|
||||||
|
@ -32,7 +35,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
const password = document.getElementById("login-password").value;
|
const password = document.getElementById("login-password").value;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE}:8083/users/authenticate`, {
|
const response = await fetch(`${API_BASE}:${USER_PORT}/users/authenticate`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ email, password }),
|
body: JSON.stringify({ email, password }),
|
||||||
|
@ -59,7 +62,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
const role = document.getElementById("role").value;
|
const role = document.getElementById("role").value;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE}:8083/users`, {
|
const response = await fetch(`${API_BASE}:${USER_PORT}/users`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ name, email, password, role }),
|
body: JSON.stringify({ name, email, password, role }),
|
||||||
|
|
Loading…
Add table
Reference in a new issue