Back

[SOLVED] Authorisation issue in appwrite cloud

  • 0
  • Web
  • Storage
Anurag
16 May, 2023, 03:37

hey there ,

i'm , getting this error when try to upload a image to bucket in appwrite cloud

AppwriteException: The current user is not authorized to perform the requested action.

if i'm right we have to pass api key also . but i didn't see any mention of it in docs (maybe i can be wrong).

I am using web sdk , and nextjs with ts.

here's live url : https://host-thing.vercel.app/

here's github link : https://github.com/anuragts/host-thing/blob/main/src/pages/components/Appwrite.tsx

TL;DR
There was an authorization issue in Appwrite cloud, but it has been solved by adding permission for guests. The issue was caused by using an API key client-side, which is not recommended as it can expose the key to end users. The user should check what permissions were set on the bucket. The user was experiencing an error when trying to upload an image to a bucket in Appwrite cloud, resulting in the AppwriteException: The current user is not authorized to perform the requested action. The user was unsure if they needed to pass an API key, but they didn't see any mention of it in the documentation. The user is using
Drake
16 May, 2023, 03:41

You should NOT be using an API key client side as that would expose it to end users.

As for your problem, what permissions did you set on the bucket?

Anurag
16 May, 2023, 03:56

solved , added permission for guests.

Drake
16 May, 2023, 03:57

[SOLVED] Authorisation issue in appwrite cloud

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