Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Error accessing Sanity studio with Nextjs template, resolved by updating project ID.

3 replies
Last updated: Jun 2, 2023
Hello Everyone, I was hoping someone can point me in the right direction. I am trying to use Sanity studio with my Nextjs template. I have created a project from Sanity.io , got the projectID from the sanity dashboard and added the Project ID to the .env file. all seem Ok but whn I go to the local host: http://localhost:3000/admin . I get redirected to a login page where I see all the providers you can use to log in. whether I choose github or Gmail I am getting this error " You are not authorized to access this studio.Maybe you could ask someone to invite you to collaborate on this project?
If you think this is an error, verify that you are signed in with the correct account. You are currently signed in as <my name - my email> through (google/Github).
I have also invited a project member and gave him an Admin role and I am getting the same error using the newly added member credentials.
Jun 2, 2023, 9:49 AM
Hi
user A
. It could be that your project ID isn’t updated throughout the project and it’s picking up the ID from the template. Perhaps if you search for
projectId
and
PROJECT_ID
across your project, you’ll find a rogue instance of a project ID that’s not yours. Please let us know how that goes.
Jun 2, 2023, 3:48 PM
Hi
user A
, I appreciate the swift reply, I have tried your suggestion and indeed I have found another instance of projectId that wasn't mine. I have changed the id and it is working now. Many thanks for that!
Jun 2, 2023, 4:00 PM
Great! 🎉
Jun 2, 2023, 4:00 PM

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?