vapi
vapi copied to clipboard
Fix api2/user/login
There is a discrepancy between postman docs that specify JSON payload and the current implementation that uses x-www-form-urlencoded. This pull request fixes this issue.
Currently this is possible:
curl http://localhost/vapi/api2/user/login -X POST -d '[email protected]&password=zTyBwV/9'
# {"success":"true","token":"REDACTED"}
But the postman docs says the payload should be a JSON:
{
"email":"",
"password":""
}
After my change, the application accepts the JSON payload.
curl http://localhost/vapi/api2/user/login -X POST -H 'Content-Type: application/json' -d '{"email": "[email protected]", "password": "zTyBwV/9"}' -v
# {"success":"true","token":"REDACTED"}
Could you confirm if you have tested this and its working fine? Thanks
I believe in the previous code also it used to accept JSON, Maybe the code that you have committed strictly checks for JSON, Is that the case?