-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Hello json-server-auth team,
Context:
Receive 400 error so I can understand I send a bad request. However seems everything fine in my side. So please tell me if I miss something.
My log track the following output:
POST /login 400 1.362 ms - 20
Code:
Request API url :
`
const authEndpoint = "http://localhost:3000/login"
fetch(authEndpoint, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: this.state.email,
password: this.state.password,
}),
}).then((response) => {
console.log(response.status)
response.status})
.catch((error) => {
console.error(error);
});`
My db.json config file:
`
{
"signal": [
{ "id": 1, "category": "Fuite d'eau", "user": "[email protected]", "description": "Fuite d'eau issuen de l'étage 2" }
],
"login":[
{"email": "[email protected]", "name": "David", "lastname": "M", "password":"test"},
{"email": "[email protected]", "name": "David", "lastname": "M", "password":"weloveyou"},
{"email": "remi@test", "name": "Remi", "lastname": "P", "password":"weloveyou"},
{"email": "thomas@test", "name": "Thomas", "lastname": "S", "password":"weloveyou"}
]
}
`
cristofersousa, js31415 and 3baaady07
Metadata
Metadata
Assignees
Labels
No labels