I need to deliver the Api token from the json response not the header
Hello, i'm working with a Nuxt.js project, i'm using Bagisto as backend and i need to get the Token from the JSON response not the header, when i log-in via API i get a "true" instead of the token.
What do i need to do to display the token in the JSON response?
rahul last edited by
Do the following -
- Open 'app.php' file of config folder & add the below code in providers array
- Run the following command from root of your project
php artisan jwt:secret
3: . Send token=true for login end point to get token
(eg. http://localhost/191/bagisto/public/api/customer/login?token=true )
Thanks Rahul you saved me
I got many difficulties applying the Api in the front End even after your solution, there are some steps missing yet:
- You must register the middleware for auth.jwt
- There are other steps in between but the current version of Bagisto got it done until the middleware in the Api routes, so you can add the middleware like this
and that way you can use your Bagisto api with Nuxt.js official Auth module, at least it works for me
sandeep last edited by
I got token in my Login API. How to use this Api to Add product in wishlist or Cart or any Api of customer data and order?
wearecoders last edited by
Thank you so much. It is a great help from bagisto Forums. Thanks again to all.