✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

CORS Origins - Can I Create, Update and Delete Data on My Local Host?

8 replies
Last updated: Jun 23, 2020
I have my CORS Origins set and a Toke with Read+Write permissions. I'm able to create, update and delete data on my local host, but not on the deployed site. I've also tried setting up the CORS origin with and without the Allow Credentials radio button activated. Any ideas?? Please 😫
Jun 22, 2020, 9:49 PM
What is the error you are getting?
Jun 22, 2020, 10:07 PM
The mutation(s) failed: mutation failed on document "5828d6c1-c788-4301-ad1d-c77c073f3122": Insufficient permissions; permission "create" required.
Jun 22, 2020, 11:09 PM
But I checked, the token has both Read and Write permissions.
Jun 22, 2020, 11:09 PM
That error came from the browser post attempt. This one was from a file upload attempt:
Jun 22, 2020, 11:13 PM
Object { description: "The mutation(s) failed: mutation failed on document \"perm-check-RGciEJEJoTTThSZf\": Insufficient permissions; permission \"create\" required", items: (1) […], type: "mutationError" }
Jun 22, 2020, 11:21 PM
Very weird. Could you send me a private message with the project ID and dataset in question?
Jun 23, 2020, 1:33 AM
Did you figure this one out? (seems to be token related, and not CORS related?)
Jun 23, 2020, 5:16 AM
Yes, it was an environment variable/token issue
Jun 23, 2020, 6:50 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?