From 7a7e5bd2b45299655e2e78c30fbad8163ca19be6 Mon Sep 17 00:00:00 2001 From: Hasin Hayder Date: Sat, 21 May 2022 18:21:27 +0600 Subject: [PATCH] Readme --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d9831b..c09b6fa 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,45 @@ You will get a JSON response with user token. You need this admin token for maki } ``` -For any unsuccsesful attempt, you will receive a 401 response. +For any unsuccsesful attempt, you will receive a 401 response. + +```json +{ + "error": 1, + "message": "invalid credentials" +} +``` + +### User Authentication (Other Roles) + +You can login as a user by making an HTTP POST call to the folllowing route + +```shell +http://localhost:8000/api/login +``` + +**API Payload & Response** + +You can send a Form Multipart or a JSON payload like this + +```json +{ + "email":"user@hydra.project", + "passsword":"Surprisingly A Good Password" +} +``` + +**API Response** +You will get a JSON response with user token. You need this admin token for making any call to other routes protected by admin ability. + +```json +{ + "error": 0, + "token": "2|u0ZUNlNtXgdUmtQSACRU1KWBKAmcaX8Bkhd2xVIf" +} +``` + +For any unsuccsesful attempt, you will receive a 401 response. ```json {