Closed bloodf closed 3 years ago
definitely a bug
this is the fix, in core/lib/sync/task.ts
This prevents a headers Bearer to be set at all if token doesn't exist (guest user)
Otherwise the header is set only partially Bearer {empty token}
and VSF-API getToken
fails
From vue-storefront created by teuma86: vuestorefront/vue-storefront#5317
Current behavior
Setting users.tokenInHeader = true on both the API and VSF instance, with Magento 2 as a backend fails to create a quote if the customer is not logged in. Thus failing to load shipping methods / payment methods. The error returned from magento is {"code":500,"result":"The consumer isn't authorized to access self."}
This appears to work fine for a logged in customer
This appears to work fine when setting users.tokenInHeader=false in both instances. (VSF AND API)
Expected behavior
Steps to reproduce the issue
have users.tokenInHeader = true, Magento backend (M2.3 and M2.4), VSF 1.12, VSF-API 1.12
Try adding to basket when not logged in Note the network calls / console logs.
Version of Vue Storefront
Can you handle fixing this bug by yourself?
Which Release Cycle state this refers to? Info for developer. (doesn't apply to Next)
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Environment details
Additional information