Laravel JWT Authentication tutorial:
- laravel new project-name
- composer require tymon/jwt-auth:dev-develop --prefer-source
Endpoint : 127.0.0.1:8000/api/register Method: POST Payload:
name: Name email: email@email.com password: secret password_confirmation: secret
Endpoint : 127.0.0.1:8000/api/login Method: POST Payload:
email: email@email.com password: secret
Endpoint : 127.0.0.1:8000/api/open Method: GET
Endpoint : 127.0.0.1:8000/api/open Method: GET Payload:
Authorization: Bearer insert_user_token_here
Endpoint : 127.0.0.1:8000/api/user Method: GET Payload:
Authorization: Bearer insert_user_token_here
Endpoint : 127.0.0.1:8000/api/user Method: GET Payload:
Authorization: Bearer wrongtoken
Endpoint : 127.0.0.1:8000/api/closed Method: GET