Back

Issue with users.get() within Appwrite Cloud Function

  • 0
  • Self Hosted
  • Users
  • Cloud
larkx
12 Oct, 2023, 22:58

When I try and execute this code within my Appwrite Cloud Function, I get this error:

TypeScript
const user = await users.get(userID) // 'userID' = req.headers['x-appwrite-user-id']
TypeScript
User (role: guests) missing scope (users.read)

I tried looking online but couldn't really find a solution, does anyone know why this is happening?

TL;DR
The user is encountering an error with the `users.get()` function within their Appwrite Cloud Function. The error message suggests that the user is unauthenticated or missing the required scope for reading users. The user has tried searching for a solution online but hasn't found one yet.
larkx
12 Oct, 2023, 22:58

Issue with getting user within Appwrite Cloud Function

larkx
12 Oct, 2023, 22:58

Issue with user.get() within Appwrite Cloud Function

larkx
12 Oct, 2023, 22:58

Issue with users.get() within Appwrite Cloud Function

Drake
13 Oct, 2023, 01:13

role: guests

This always mean you're unauthenticated. Perhaps you're not passing an API key or the API Key is invalid.

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