- Send an POST request to
/auth/register
- Set the content type to JSON
- Include in the request body a JSON object containing all the data you wish to save about your user
- required fields: "email" and "password"
- optional fields: currently just "name", but ask the back-end lead once those tasks are underway
- JSON representing the newly saved user, now with
_id
andcreatedAt
fields OR - an error message
- Send a POST request to
/auth/login
- Set the content type to JSON
- Include in the request body a JSON object with the fields "email" and "password"
- JSON representing the newly logged-in user OR
- an error message
- Send a GET request to
/auth/logout
- JSON containing a message confirming logout OR
- an error message
- Sessions are maintained server-side
- Every response from the server will always contain a cookie with the key
ironPong_user
- The value will be
null
if there is no current user session; otherwise the value will be the current user as a JSON object