curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"msg": "Login is only allowed with an @adgitmdelhi.ac.in email or a valid user ID."
}
Authenticate a user and receive a JWT token
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"msg": "Login is only allowed with an @adgitmdelhi.ac.in email or a valid user ID."
}
curl -X POST https://api.meetmates.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "securepassword123"
}'
{
"email": "[email protected]",
"password": "securepassword123"
}
Bearer <token> for protected endpoints{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1N2Y0ZDhlOTBjMjNhNDU2N2IzOGY5MSIsImlhdCI6MTcwMjg5NzYwMCwiZXhwIjoxNzAzNTAyNDAwfQ.xyz123..."
}
{
"msg": "Login is only allowed with an @adgitmdelhi.ac.in email or a valid user ID."
}
id: User’s MongoDB ObjectIdiat: Token issued at timestampexp: Token expiration timestamp (7 days from issue)curl -X GET https://api.meetmates.com/api/protected-endpoint \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."