Comments (3)
With the last commit in mind I found a solutions that works:
add_filter('graphql_woocommerce_cart_session_before_token_sign', function ($token) {
if (is_user_logged_in()) {
$token['data']['customer_id'] = get_current_user_id();
}
return $token;
});
This way I generate a jwt-token containing the correct customer-id to start with.
So... the bug lies in JWT_Auth_Schema_Filters
in the fieldResolve for sessionToken starting from line 197. When using the login-mutation, the customer-id is not set after the login went through and before setting the session-token is generated.
from wp-graphql-woocommerce.
Okay. Further investigation shows, the issue lies in the woocommerce-session-token. It seems my session token does not contain the correct user-id.
The Session-Token I use is the one returned by the login-mutation in customer.
Very strange.
from wp-graphql-woocommerce.
Note: this also affects Headless Login for WPGraphQL, assumedly for the same reasons though I've yet to try @davidfaber 's workaround
from wp-graphql-woocommerce.
Related Issues (20)
- Problem with offset pagination and polylangs language filter parameter. HOT 1
- Is there support for WooCommerce Dynamic Pricing & Discounts
- How to get availableShippingMethods include tax when taxable setting is on
- Missing pageInfo fields HOT 1
- WPML with wp-graphql throwing error: Field "language" is not defined HOT 3
- Guests who use the same billing email can see each others orders in the customer object? HOT 2
- Losing wp_woocommerce_sessions value on page refresh.
- Get Products by taxonomyFilter - Multiple Terms HOT 2
- Product where categoryIn only returns first category queried
- Order by price break pagination
- Order products by stock status HOT 1
- Get Stripe's client_secret into FE HOT 1
- ProductCategoryToProductConnection getting not related products HOT 1
- Setting amount of products in pagination not working HOT 8
- Cannot query subcategories of productCategories HOT 1
- GraphQL Query Returns Incomplete List of WooCommerce Product Variations HOT 1
- The API is too slow, is there any way to speed it up? It takes up to 4.5s to query 9 products. HOT 2
- Not working with WPGraphQL ACF HOT 1
- Add rest api equivalent to Product Attributes queries and mutations.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-graphql-woocommerce.