# Login User
# Login to User Account
To ensure the security and integrity of our platform, we require that all users authenticate themselves before creating posts, commenting, or replying to a comment. This means that users must provide valid login credentials, such as a email and password to verify their identity.
#
# Request
- HTTP Method:
POST
- accept :
application/json
- Content Type :
application/json
- URL:
https://comments-api-production.up.railway.app/users/login-user
# Body Parameters
Property | Type | Required | Description |
---|---|---|---|
email | string | true | The email of the user |
password | string | true | The password of the user |
# Request example
curl -X POST \
'https://comments-api-production.up.railway.app/users/login-user' \
-H 'accept : application/json' \
-H 'Content-Type : application/json' \
-d '{
"email" : "johndoe@mail.com",
"password" : "Password1234&"
}'
# Expected Responses:
# Successfull Login
You have logged in successfully
{
"statusCode":200,
"responseValue":{
"message":"Login Success",
"jwt":"eyJhbG0qFQIZ4Z6ZhchiW1-QDpqwSAGOhg"}
}
# Other Responses:
# Email Cannot be Found
Your email cannot be found on the database
{
"statusCode":404,
"message":["Your email cannot be found"],
"error":"Not found"}
# Incorrect Password
Your password is incorrect
{
"statusCode":401,
"message":["Your password is incorrect"],
"error":"Unauthorized"}
# Playground
Method: POST
URL: https://comments-api-production.up.railway.app/users/login-user
Headers:
Key | Value |
---|---|
accept | |
Content-Type |