Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
2 replies
Mordi

Updating profile pictures from next-auth providers

So I am trying to get next-auth to update the user's profile picture when they sign in. Googling lead me to this: https://github.com/nextauthjs/next-auth/discussions/1414

Which seems very reasonable, so I am adding some logic to the sign in callback In [...nextauth]. The problem I am facing is that I am not can't seem to get the image URL/id to check against the one saved in my DB.

The attached Image shows that the profile object contains what i want, the avatar or the image_url is all I need. Intellisense gives me an profile.image suggestion, which returns undefined, and cant seems to do anything like profile.avatar or profile.image_url to get the value.

Am I just missing some TS trick to get the avatar value from the profile object?
monkaHmm.png
GitHub
Your question I'm successfully storing a user's profile image (using the standard Discord provider), but it seems after the user changes their profile image it never updates in the ...
How to update user's profile image beyond first login · nextauthjs/...
Was this page helpful?