How to authenticate role with checkout ui extension
GGT_PERMISSION_DENIED: The
unauthenticated
role cannot read customerLoyalty
records. To allow this, grant access in your app's permissions. To learn more:
Helo! Hope you are well. How do I add a role if I have a checkout UI extension.6 Replies
Hello,
Checkout UI extensions sessions can't be authenticated because its in the storefront.
What are you trying to do?
Hi! I want to fetch data to use in checkout ui
thats it
Simple data from a model, further down the line I might want to call actions as well
You won't really be able to get customer related data in a safe manner in the checkout (again its an unauthenticated space)
I would recommend seeing if you can use an app proxy to get certain fields in requests like shopId and logged in customer. Here are some links that might (using that loosely) help:
https://docs.gadget.dev/guides/plugins/shopify/advanced-topics/customer-account-ui-extensions#what-does-enabling-customer-account-authentication-do
https://github.com/gadget-inc/templates/tree/main/shopify/wishlist-public-remix-ssr
oh I see - even if customers are logged in?
Adds a "shopify-storefront-customers" role that identifies storefront extension users by customer ID to access model records with specific permissions.
For my case the customers will be logged in and in checkout - not anonymous checkout
I don't know if the same applies to checkout ui extensions. It all depends on the API available in the extension
If you have more questions on the topic don't be afraid to ask. For now, I'm going to close the conversation
Do you like this answer?