Open-Assistant
Open-Assistant copied to clipboard
fix for invalid avatarUrl error
fix for https://github.com/LAION-AI/Open-Assistant/issues/1985
If the avatarUrl ends up being invalid, it will use the same default value as if the avatarUrl is missing.
I tried to fix it without useState but it caused flickering as Next.js kept trying to fetch the invalid url

Thank you. But this only mitigates the problem. The root problem is we don't update the discord avatar (except for the first login). Can you address this? You need to add the logic to the signIn
event in [...nextauth].ts
file
Thank you. But this only mitigates the problem. The root problem is we don't update the discord avatar (except for the first login). Can you address this? You need to add the logic to the
signIn
event in[...nextauth].ts
file
I can try and attempt this tonight. Would the behaviour you expect then be to update the image url every sign in regardless of it changing? Or first get the user then check if the profile.image differs from the user.image?
I am not really sure how to go on about this, is signin
called only when the user signs in with username and pass? or is an outdated session also considered a sign in? we need to update the images just the right amount of times.
Thank you. But this only mitigates the problem. The root problem is we don't update the discord avatar (except for the first login). Can you address this? You need to add the logic to the
signIn
event in[...nextauth].ts
fileI can try and attempt this tonight. Would the behaviour you expect then be to update the image url every sign in regardless of it changing? Or first get the user then check if the profile.image differs from the user.image?
Update when image_url change is good, but only update when user signin with discord.
I am not really sure how to go on about this, is
signin
called only when the user signs in with username and pass? or is an outdated session also considered a sign in? we need to update the images just the right amount of times.
signin
is called when the user sign in succeed, no matter what sign in method they use
signin is called when the user sign in succeed, no matter what sign in method they use
My question was more on the behavior of next-auth
, if it would call signin
after a discord session has expired, or just session
.
I signed in to our website with my discord only once since we created the app, it won't help us if signin
is called only once.
I am going to check the behavior
signin is called when the user sign in succeed, no matter what sign in method they use
My question was more on the behavior of
next-auth
, if it would callsignin
after a discord session has expired, or justsession
.I signed in to our website with my discord only once since we created the app, it won't help us if
signin
is called only once.I am going to check the behavior
Let me know what you find/found