
I called avatars.getInitials() after client.get() still getting a pure pink avatar

I could just use the name provided with client.get but I'm wondering if this is a bug or something

What version of Appwrite and what version of the SDK?
If you log in with someone else what do you see?

Wdym someone else? Appwrite v1.4.3 SDK v13 I think

I meant a different user account
Although actually I think this might be a 3rd party cookie problem...is your Appwrite endpoint a subdomain of your app? (e.g. appwrite.myapp.com for myapp.com)?

I'm using localhost

But how can it be a cookie problem when I can fetch user account and session?

I have tried logging out and in before

And is your Appwrite domain localhost too?

No

Development environment

But if it cookie problems, how does appwrite cloud handle it?

If you're using the same domain for your Appwrite instance and website, you will not face problems since it's the same domain, so it will be first party cookies. If not, it will be third party cookies and due to that it could fail

Then it's localhost

I use the same database both in dev and production lol

But I could just get the user account and use the name it provided

People set up custom domains in Appwrite cloud


Ah okay thanks. I'll try with all protection disabled later, and also check localStorage

I found the problem, and I think it should probably be documented. I have checked the network request and realised the request was being sent from /_next/image?url=xxx
. That means the cookies are not persisted because Nextjs use it's own image optimisation and sent a request from the server not the client. When I switch from next/image
's <Image />
to <img />
it worked fine.

Interesting..nextjs is such a pain 😜

haha, it's just image optimization, so I think it should be pretty common

[SOLVED] getInitials return empty avatar even when the user is logged in
Recommended threads
- Unable to read session cookie
Hi, when I am hitting Appwrite **/account** API. I am getting the user account details as expected in the response. However, with that API, Appwrite also adds a...
- Database error
My code: await databases.createDocument( process.env.APPWRITE_DATABASE, process.env.APPWRITE_COLLECTION_USER, data.userId, ...
- No Headers
Hi I have 2 appwrite functions, one is working fine on localhost, second is not even working on prod with https, i inspected the api call, no headers are being ...
