curl --request POST \
--url https://api.example.com/api/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'{
"token": "<string>",
"username": "<string>",
"error": "<string>"
}Authenticate a user and receive an access token
curl --request POST \
--url https://api.example.com/api/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'{
"token": "<string>",
"username": "<string>",
"error": "<string>"
}"I can't see a single field you filled" - Missing username or password"user not found" - No user exists with the provided username"wrong password" - Password does not match stored credentialscurl -X POST https://api.mirage.com/api/login \
-H "Content-Type: application/json" \
-d '{
"username": "johndoe",
"password": "securepassword123"
}'
{
"token": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"username": "johndoe"
}
check_password_hash function