This repository was archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
API.Routes.Login
Mestre-Tramador edited this page Oct 19, 2022
·
2 revisions
/login
Try to authenticate a User on the system.
| Name | Value | Description |
|---|---|---|
| Content-Type | application/json |
The User credentials shall be passed as JSON. |
{
"email": "user@exper.com",
"password": "exper_password"
}| Field | Type | Required | Description |
|---|---|---|---|
string |
true |
The email registered on the database. | |
| password | string |
true |
The password set. |
{
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6ImV4cGVyX3Bhc3N3b3JkIiwiZW1haWwiOiJ1c2VyQGV4cGVyLmNvbSJ9.8FIAGHu2bfHb689bK7AXSgN_ow_T8A5h9XAjkCH8lQE",
"token_type": "bearer",
"user": {
"id": 99,
"name": "Matheus Mathias",
"email": "matheus.math@exper.com",
"creation": "2022-02-14 13:21:36"
}
}Returns the JWT to be used on further requests. It also give the User logged in.
{
"message": "Already logged in"
}If an attempt is made when a token is being used.
{
"error": "There is no User with this credentials registered!"
}This error occur when there is no User registered with the given email.
{
"error": "Unauthorized"
}This error occur when the given password is incorrect.
{
"field": [
"First problem with the field.",
"Second problem..."
]
}Each one of the Request Body fields can be a key, with an array of strings detailing the errors.
Exper-Dat-Reader is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
If you'd like to contribute, please read our Contribution Guidelines.