POST /api/v0/sessions
Content-Type: application/json
Accept: application/json
Requirements:
This POST endpoint should NOT call your endpoint like /api/v0/sessions?email=person@woohoo.com&password=abc123, and should NOT send as form data either. You must send a JSON payload in the body of the request
in Postman, under the address bar, click on “Body”, select “raw”, which will show a dropdown that probably says “Text” in it, choose “JSON” from the list
this is a hard requirement to pass this endpoint!
A successful request returns the user’s api key.
An unsuccessful request returns an appropriate 400-level status code and body with a description of why the request wasn’t successful.
Potential reasons a request would fail: credentials are bad, etc
Security tip: never tell a user which field (email/password) is incorrect, as this alerts malicious users how to attack your site (eg, if they’ve guessed a correct email address, and you tell them the password is bad, then they don’t need to keep guessing email addresses, and can just try to crack the password)
POST /api/v0/sessions Content-Type: application/json Accept: application/json
Requirements:
This POST endpoint should NOT call your endpoint like /api/v0/sessions?email=person@woohoo.com&password=abc123, and should NOT send as form data either. You must send a JSON payload in the body of the request
A successful request returns the user’s api key. An unsuccessful request returns an appropriate 400-level status code and body with a description of why the request wasn’t successful.