app-generator / api-server-laravel

Laravel API Server - Open-Source API Server | AppSeed
https://appseed.us/boilerplate-code/laravel-boilerplate
Other
10 stars 1 forks source link

Tests / Login - Expected I/O #3

Closed app-generator closed 3 years ago

app-generator commented 3 years ago

API URL : http://localhost:5000/api/users/login

Request Headers

Request Body

{
    "password":"pass", 
    "email":"test@appseed.us"
}

Response for success

{
    "success": true,
    "token": "JWT_TOKEN_HERE",
    "user": {
        "_id": "1",
        "username": "test",
        "email": "test@appseed.us"
    }
}

Response for failure - wrong password or email

{
    "success": false,
    "msg": "Wrong credentials"
}