There was an error while loading. Please reload this page.
Here is a basic example of how Tokenable works, with Curl. First, make a request to login
curl --location --request POST 'http://localhost:3000/login' \ --form 'email="email@example.com"' \ --form 'password="password123"'
This will then return your token, and user_id.
{ "data":{ "token":"eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJfaWQiOjEsInZlcmlmaWVyIjoiM2ExZGNlODItN2YwNC00Mjk1LTljN2QtYzUzYmQ4OGVjNTI3In0sImV4cCI6MTYxMTgzNTA5NH0.UShx3dxVNqGVVih9XoVFboc4p7jzqI2LQAz1-8xUG0I", "user_id":1 } }
You should then use that token in all future requests to your API:
curl --location --request GET 'http://localhost:3000/user' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJfaWQiOjEsInZlcmlmaWVyIjoiM2ExZGNlODItN2YwNC00Mjk1LTljN2QtYzUzYmQ4OGVjNTI3In0sImV4cCI6MTYxMTgzNTA5NH0.UShx3dxVNqGVVih9XoVFboc4p7jzqI2LQAz1-8xUG0I'