🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Error connecting to Sanity studio and resolving the issue of not being authorized to access the studio.

27 replies
Last updated: Jan 5, 2023
Hello ! I want to use Sanity with a react native app. However, when I have to connect to the studio, I get this error: "You are not authorized to access this studio. Maybe you could ask someone to invite you to collaborate on this project?" Where can I check which account the studio is linked to?
Jan 5, 2023, 9:43 PM
Or you should use the cli to login:
sanity login
You need to be authenticated to use the cli/client as well as the site.
If that does not work, you need to tell us where the error occurs
Jan 5, 2023, 9:50 PM
I have the same error..
Jan 5, 2023, 9:59 PM
I tryed to login with sanity account and another time with my google account but the error persists
Jan 5, 2023, 10:00 PM
You need to be more specific please. Did you try GitHub as well? You can also share the ID of the project with us (DM to
user Y
)
Jan 5, 2023, 10:02 PM
I initialized sanity following the guide on your documentation, once installed I connected to the CLI with sanity login, when I went to localhost:3333 to connect with the same account I get this error:
Jan 5, 2023, 10:03 PM
Hey
user H
, what is the projectID?
Jan 5, 2023, 10:05 PM
I'm sending you a private message
Jan 5, 2023, 10:05 PM
ProjectIDs are public, but that works too!
Jan 5, 2023, 10:06 PM
oc05323k

Jan 5, 2023, 10:06 PM
I just took a look on the backend and It looks as though you haven’t invited your email account (the one from your screenshot that starts with a
y
) to this project yet.
Jan 5, 2023, 10:07 PM
How can i invite my email ?
Jan 5, 2023, 10:09 PM
You’ll want to go to manage.sanity.com and make sure you are logged in with the admin account for the project (not the one with the email address that starts with a
y
), then go to members and invite this new email address you are attempting to sign in with.
The other option is to instead during this process sign in with the correct email that is an admin:

I initialized sanity following the guide on your documentation, once installed I connected to the CLI with sanity login, when I went to localhost:3333 to connect with the same account I get this error:
Jan 5, 2023, 10:09 PM
What is the admin email ? It's my first time with sanity i just loged in you website with my y.... email and initalized sanity on my project with the cli
Jan 5, 2023, 10:10 PM
bbe**************<mailto:k@gmail.com|k@gmail.com>
Not sure how comfortable you are sharing your email so it is obscured
Jan 5, 2023, 10:12 PM
Oh... wait... it's the email of my client 😂
Jan 5, 2023, 10:13 PM
How can i change the admin account ?
Jan 5, 2023, 10:14 PM
You’ll want to have them log in and invite you then following the steps I mentioned above
Jan 5, 2023, 10:14 PM
Or create a new project using your email credentials as the admin account (seeing as how this project looks to be empty), and then invite your client once it is set up if needed.
Jan 5, 2023, 10:15 PM
Should I follow these steps?
Jan 5, 2023, 10:18 PM
You can, but that is unrelated to your question. To clarify:1. Your client has an account with Sanity, and that account is the
admin of the project. 2. You are attempting to connect the project with a react app, but you don’t have access because your client hasn’t authorized you to be a member or admin of the project yet.
3. So you need to either
A) have them log in and invite you then following the steps I mentioned above OR B) create a new project using your email credentials as the admin account (seeing as how this project looks to be empty), and then invite your client once it is set up if needed, linking your react app to the new project (and in this case yes you can follow that guide to create a project)I hope that helps, sorry for any confusion
Jan 5, 2023, 10:22 PM
Yes i understand but where can i create a new project using my email credentials as the admin account ? when i click on "create first project" on sanity.io/manage (connected with my account) it redirects me to this page: https://www.sanity.io/docs/create-a-sanity-project
Jan 5, 2023, 10:25 PM
So it's an infinite loop since I've been following the steps on this page since the beginning
Jan 5, 2023, 10:25 PM
You can follow the steps on that page or you can create a project from the CLI using
sanity init
Jan 5, 2023, 10:27 PM
Okay thank u !!!
Jan 5, 2023, 10:30 PM
Also if you are in a directory where sanity is installed you can use the command
sanity help
for more specific commands and information that may be helpful commands for you
Jan 5, 2023, 10:30 PM
Okay, thank you for your time. Good night!
Jan 5, 2023, 10:31 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?