user est enregistrable mais la connexion renvoie 500 em code status
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>scribl.lidl_edition</h1>
|
||||
<h1>scribl.lidl_edition (GARE A VOS YEUX)</h1>
|
||||
|
||||
<menu id="menu">
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user