Repository navigation
AUTH
The auth/ route covers authorization and credentials by creating a session based on the user logging in. A login access returning a response with a cookie attached to it that must be sent with any subsequent requests requiring authorization.
As of right now the cookie value is sent back with the response to login in the field connect.sid and copying that key-value pair to any authorized requests will persist the session. connect.sid is required to be set in the headers of the request to logout as it contains all session data.
Login the user and create a persistent session, returning a cookie for subsequent requests needing authorization.
| Content-Type | application/x-www-form-urlencoded |
| Parameter | Type | Required |
|---|---|---|
| username | string | yes |
| password | string | yes |
| Status Code | Meaning |
|---|---|
| 200 | Login Successful. Currently response returns user object |
| 401 | Login unsuccessful, backend console log gives further information |
IMPORTANT connect.sid Cookie is returned under res.req.headers.cookie
Logout a user, removing user from passport.session.
| Content-Type | application/x-www-form-urlencoded |
| cookie | connect.sid = (valid cookie returned from login) |
| Parameter | Type | Required |
|---|---|---|
| username | string | Yes |
| password | string | Yes |
| Status Code | Meaning |
|---|---|
| 200 | Logout Successful. |
| other | Logout unsuccessful, user is not logged in |