
Given a users ID how can I get that users email and name from that Auth table?
I've tried this:
TypeScript
// middleware
export function createSessionClient(request: Request) {
const client = new Client()
.setEndpoint(import.meta.env.PUBLIC_APPWRITE_ENDPOINT)
.setProject(import.meta.env.PUBLIC_APPWRITE_PROJECT)
...
return {
...
get users() {
return new Users(client)
},
}
...
// another component
const { users } = createSessionClient(Astro.request)
console.log('a user: ', await users.get('00ac6251002f1e33b849'))
And I always get: (role: users) missing scope (users.read) Even though I've enabled users.read (screenshot)
TL;DR
To get a user's email and name from the Auth table using the Appwrite SDK, you must grant the users.read scope. Ensure the scope is enabled despite already checking it, as it seems to be the root cause of the issue you are facing. Recommended threads
- 404 Collection not found
I am trying to open storage bucket in the appwrite console, when I click on bucket it says "Collection not found" Contents are loading fine in the website but n...
- webhook signature verification
I'm trying to use a payment services webhook and verifying the signture. I'm having some trouble with processing payload. the webhook.verify function in stand...
- getFilePreview returns ByteCode
I'm running this code: ```js blah = await storage.getFilePreview( import.meta.env.NEWS_IMAGES_ID, news.imageId, 0, // width (optional) 0, // h...
