Open differentMonster opened 2 years ago
I have the same problem, did you figure out a solution?
Strangely, when querying a specific few WP/WC rest endpoints the CORS issue seems to come up. I discovered that when NOT fetching these endpoints with basic auth (as is the default setting), but via the query string instead (which does mean exposing the consumer key and secrets via URL), the CORS issue does not seem to come up.
Using this library that would look like: const api = new WooCommerceRestApi({ url: shopSettings?.url, consumerKey: shopSettings?.consumer_key, consumerSecret: shopSettings?.consumer_secret, version: "wc/v3", queryStringAuth: true, });
Hope this helps!
i wanted to create a customer account sending data from frontend to my wordpress woocommerce restful api and i have this error.
here is my post code
anyone facing this problem, how do i bypass the CORS policy ? i am testing on localhost