Back

appwrite exception: User not authorised to perform this action.

  • 0
  • Databases
  • Auth
  • Web
  • Cloud
Ishrit Madaan
24 Mar, 2024, 04:38

https://github.com/Prabhat-Chandela/mega-project-02.git

In the signup process when I am creating a document to store user profile It is giving the error appwrite exception: User not authorised to perform this action. The function that is giving error is called from the signup component and .create user profile() method I made is calling the create document from appwrite which is giving error

But the document is still being created on the appwrite cloud console I have checked But why is then the api response coming with this error .

Other things are working but why is creating this document is giving error

I have checked permissions I have given Role of any with all permissions to the collection

TL;DR
Developers are encountering an "appwrite exception: User not authorised to perform this action" error when creating a document to store a user profile. Despite the document being created in the Appwrite cloud console, the API response returns the error. **Solution:** Make sure to use a single client instance instead of creating a new `Client` instance for every service. This may resolve the authorization issue. Also, check the permissions and role settings for the collection.
darShan
24 Mar, 2024, 04:45

Possibly because you are using a new Client instance for every service. Does it work if you use a single instance?

Ishrit Madaan
24 Mar, 2024, 04:45

But that would be called only once

Ishrit Madaan
24 Mar, 2024, 04:47

So you think I should try to make one client for all 3 services ??

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more