Commit ae807c23 authored by thibaut-felten's avatar thibaut-felten

Doc 12

parent 14ede517
......@@ -2,19 +2,19 @@
// Config Eden
define('DB_HOST','localhost');
define('DB_PORT',3306);
define('DB_DBNAME','thibaut_felten');
define('DB_USER','thibaut.felten');
define('DB_PASSWORD','YpIaegvG');
// define('DB_HOST','localhost');
// define('DB_PORT',3306);
// define('DB_DBNAME','thibaut_felten');
// define('DB_USER','thibaut.felten');
// define('DB_PASSWORD','YpIaegvG');
//Config local
// define('DB_HOST','localhost');
// define('DB_PORT',3306);
// define('DB_DBNAME','dbtest');
// define('DB_USER','root');
// define('DB_PASSWORD','root');
define('DB_HOST','localhost');
define('DB_PORT',3306);
define('DB_DBNAME','dbtest');
define('DB_USER','root');
define('DB_PASSWORD','root');
define( 'JWT_BACKEND_KEY', '6d8HbcZndVGNAbo4Ih1TGaKcuA1y2BKs-I5CmP' );
define( 'JWT_ISSUER', $_SERVER['HTTP_HOST'] . $_SERVER['CONTEXT_PREFIX']);
\ No newline at end of file
......@@ -4,7 +4,7 @@
Used to collect a Token for a registered User.
**URL** : `/api/login/`
**URL** : `/api.php/login/`
**Method** : `POST`
......@@ -14,8 +14,8 @@ Used to collect a Token for a registered User.
```json
{
"username": "[valid email address]",
"password": "[password in plain text]"
"login": "[valid email address]",
"pwd": "[encrypted password]"
}
```
......@@ -23,8 +23,8 @@ Used to collect a Token for a registered User.
```json
{
"username": "iloveauth@example.com",
"password": "abcd1234"
"username": "email@example.com",
"password": "$2y$12$K7wi3XvwEZuODOGmwOgeKO1oBFhIjjuZJpmzYjMpDQ5BB9YIBAJ/6"
}
```
......@@ -36,22 +36,15 @@ Used to collect a Token for a registered User.
```json
{
"token": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d"
"jwt_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDYwNjA5MzMsImV4cCI6MTYwNjA2NDUzMywiaXNzIjoibG9jYWxob3N0IiwiZGF0YSI6eyJpZCI6IjMiLCJmaXJzdG5hbWUiOiJ0ZXN0IiwibGFzdG5hbWUiOiJ0ZXN0IiwiZW1haWwiOiJlbWFpbHRlc3RAdGVzdC5jb20ifX0.pj5SnrOUA45Fleb19D7MFz9Xc2Isx6km-Ov2gG2U_d0"
}
```
## Error Response
**Condition** : If 'username' and 'password' combination is wrong.
**Condition** : Missing field pwd or login.
**Code** : `400 BAD REQUEST`
**Code** : `422`
**Content** :
**Content** : `login and pwd fields are mandatory`
```json
{
"non_field_errors": [
"Unable to login with provided credentials."
]
}
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment