commercetools / sunrise-spa

SUNRISE shop template as a single-page application
https://sunrise-spa.now.sh
Apache License 2.0
51 stars 78 forks source link

Insufficient scope #168

Closed infmelon closed 2 years ago

infmelon commented 4 years ago

Following the instructions in the readme I get the following error when setting up with my own commercetools project. The store page also doesn't show any categories or products even though they're imported through sunrise-data. image

I tried adding the view_products scope on top of the "Mobile & SPA template" scopes, but the same error occurs. Do the scopes in the template started deviating from the ones required for this project?

amsterdamharu commented 4 years ago

The work around for this is to create an api client in Merchant Center and after choosing the "Mobile & single-page application client" scope click on "Products (all)".

Then after clicking "Crate API Client" you choose to download it as "Sunrise SPA" the scope should then be:

VUE_APP_CT_SCOPE=create_anonymous_token:your-project manage_my_payments:your-project manage_my_orders:your-project manage_my_shopping_lists:your-project view_published_products:your-project manage_my_profile:your-project

If you ran the project before then make sure you run yarn serve again and in the browser developer tools remove the local storage because if it has the old token it will use that token instead.