user est enregistrable mais la connexion renvoie 500 em code status

This commit is contained in:
2026-01-12 11:46:45 +01:00
parent 3e90320f50
commit d4f36f79df
3 changed files with 23 additions and 2 deletions
+3 -1
View File
@@ -11,8 +11,10 @@ server {
# Backend API
location /api/ {
proxy_pass http://backend:3001/;
proxy_pass http://backend:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
+1 -1
View File
@@ -7,7 +7,7 @@
</head>
<body>
<h1>scribl.lidl_edition</h1>
<h1>scribl.lidl_edition (GARE A VOS YEUX)</h1>
<menu id="menu">
+19
View File
@@ -87,6 +87,7 @@ export class LoginWindow extends fenetre {
}
async connexion() {
console.log("methode connexion lancée");
const response = await fetch("/api/auth/login", {
method: "POST",
headers: {
@@ -110,6 +111,24 @@ export class LoginWindow extends fenetre {
async inscription(){
console.log("methode inscription lancée");
const response = await fetch("/api/auth/register", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
username: this.username.value,
password: this.password.value
})
});
const data = await response.json();
if (response.ok) {
console.log("OK", data);
} else {
console.error("ERROR", data);
}
}
bindEvents() {