This repo contains the user source code for the login controller. The sole purpose of this endpoint is to act as a proxy server for handling user-login within the application. Filtering faulty requests and ensuring users are properly redirected to when 2FA is enabled.
- http verb:
POST- reponse code:
200- response type: JSON
Returns a User object (see user endpoint for more information)
| param | description | type | default |
|---|---|---|---|
email |
A valid email of the user account to login with | string | |
password |
The password attributed to the account | string |
Login with credentials:
email: example@email.compassword: alphanumerical_1234
Will yeild:
{
"auth": {
"enabled": false
},
"steamid": null,
"_id": "759c48df-7815-41a6-a373-940470bb1b6f",
"username": "COMPLETE-HERON",
"email": "example@email.com",
"token": "cfa115a13e52761d858e0ac0f36e00",
"created_at": "Sun Jan 10 2021"
}
- http verb:
POST- reponse code:
200- response type: JSON
Returns a User object (see user endpoint for more information)
| param | description | type | default |
|---|---|---|---|
_id |
The uuid of the user to be used when login in the user | string | |
token |
The temporary (~30 second) valid token generated and sent to the user vie their email | integer |
Login with credentials:
email: example@email.compassword: alphanumerical_1234
Will yeild:
{
"_id": "759c48df-7815-41a6-a373-940470bb1b6f"
}Where the _id field will be used on the frontend to handle the login with 2FA and, concurrently, an email has been sent to the user where they will find their temporary login token.
Sent 2fa form to login:
_id: 759c48df-7815-41a6-a373-940470bb1b6ftoken: 480255
Will yeild:
{
"auth": {
"enabled": true
},
"steamid": null,
"_id": "759c48df-7815-41a6-a373-940470bb1b6f",
"username": "COMPLETE-HERON",
"email": "example@email.com",
"token": "cfa115a13e52761d858e0ac0f36e00",
"created_at": "Sun Jan 10 2021"
}