I need to deliver the Api token from the json response not the header
-
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
- 4 months later
-
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?
- about a month later
-
Thank you so much. It is a great help from bagisto Forums. Thanks again to all.
- 7 months later
-
@sandeep did u find the solution, how to send token to further interact with apis
- about a month later
-
-
@eolykab
you may read this guide to fixup this issue https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9 - 15 days later
-
@sandeep i have the same problem ! did you find a solution ?
- 22 days later
-
Heads up people!
After 6 hours of digging through the code base this line stood out:
$this->guard = request()->has('token') ? 'api' : 'customer';
It means even if you have the header set correctly, your mobile application will still not authenticate. So, to solve this, what you need to do is add:
cartItem.put("token",sharedPref.getCustomerApiToken());
On all objects that need to be authenticated. If stuck reach-out.
- 19 days later
-
How can i use token for adding product to cart.
I got token from login api. but when i am using this token in cart add it respond 500 error -
Hi @simi61193
May, I know the full request data and URI you are hitting.
- 12 months later
-