user est enregistrable mais la connexion renvoie 500 em code status
This commit is contained in:
@@ -11,8 +11,10 @@ server {
|
|||||||
|
|
||||||
# Backend API
|
# Backend API
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend:3001/;
|
proxy_pass http://backend:3001;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>scribl.lidl_edition</h1>
|
<h1>scribl.lidl_edition (GARE A VOS YEUX)</h1>
|
||||||
|
|
||||||
<menu id="menu">
|
<menu id="menu">
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export class LoginWindow extends fenetre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async connexion() {
|
async connexion() {
|
||||||
|
console.log("methode connexion lancée");
|
||||||
const response = await fetch("/api/auth/login", {
|
const response = await fetch("/api/auth/login", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -110,6 +111,24 @@ export class LoginWindow extends fenetre {
|
|||||||
|
|
||||||
async inscription(){
|
async inscription(){
|
||||||
console.log("methode inscription lancée");
|
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() {
|
bindEvents() {
|
||||||
|
|||||||
Reference in New Issue
Block a user