I've made a MongoDB GET
request route named users/auth to create authentication by searching for the records provided in the request's body, inside the database. When I send the request via POSTMAN then it gives the expected response (eg: "true")
But when I tried to send the same request inside my react-app with AXIOS it gives an unexpected response(eg: false) with status code: ok
. I'm not sure of what wrong I'm doing.
//some valid objects which should return true
//but it return's false
users = {
"email": 'abc@gm.com',
"password": 'abcdef'
}
axios.get('http://localhost:5000/users/auth', users)
.then(res => {
console.log(res.data);
//expected: true
// actual result: false
})
.catch(error => console.log(error))
I've read this problem but It didn't fixed my problem.