pawanpoudel/location_tester_user_service — pull request #5 by pawanpoudel (2013-10-06 23:12:07+00:00)
Title: Verify user name and password

This PR allows client code to verify if the user has an account or not. Listed below are HTTP request and response body.

POST request with valid credentials
--------------------------------------------------
~~~shell
curl -X POST -H "Content-Type: application/json" -d '{"password": "shabbos"}' http://localhost:9393/api/v1/users/walter/sessions
~~~

~~~json
{
"id": 16,
"name": "the_dude",
"email": "hisdudeness@example.com",
"bio": "Memeber of the SLF",
"created_at": "2013-10-04T00:39:20Z",
"updated_at": "2013-10-04T14:49:20Z"
}
~~~

POST request with Invalid credentials
-----------------------------------------------------
~~~shell
curl -X POST -H "Content-Type: application/json" -d '{"password": "wrong"}' http://localhost:9393/api/v1/users/the_dude/sessions
~~~

~~~json
{
"error": "Invalid login credentials"
}
~~~