Rank 3: Container
I called avatars.getInitials() after client.get() still getting a pure pink avatar
Votes
0
Replies
22
Participants
Unknown
Messages
23
Rank 3: Container
I called avatars.getInitials() after client.get() still getting a pure pink avatar
Rank 3: Container
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?
Rank 3: Container
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)?
Rank 3: Container
I'm using localhost
Rank 3: Container
But how can it be a cookie problem when I can fetch user account and session?
Rank 3: Container
I have tried logging out and in before
And is your Appwrite domain localhost too?
Rank 3: Container
No
Rank 3: Container
Development environment
Rank 3: Container
But if it cookie problems, how does appwrite cloud handle it?
Moderator
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
Moderator
Then it's localhost
Rank 3: Container
I use the same database both in dev and production lol
Rank 3: Container
But I could just get the user account and use the name it provided
People set up custom domains in Appwrite cloud
Rank 3: Container
Ah okay thanks. I'll try with all protection disabled later, and also check localStorage
Rank 3: Container
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 😜
Rank 3: Container
haha, it's just image optimization, so I think it should be pretty common
Rank 3: Container
[SOLVED] getInitials return empty avatar even when the user is logged in