-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gravatar support for user profile picture #3584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general lgtm and seems to work as expected (a few minor nits). Though I would strongly suggest we cache these images in the backend and fetch them from there. This will make sure we can use the images in other places well (e.g. emails), and we also avoid exposing our users to a third-party service (particularly concerned with self-hosted). Thoughts?
userEmail?: string | ||
} | ||
|
||
export function ProfilePicture({ userName, userEmail }: ProfilePictureProps): JSX.Element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: userName
could be confused with a username, why not just name
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
"antd": "^4.11.2", | ||
"babel-preset-nano-react-app": "^0.1.0", | ||
"chart.js": "^2.9.3", | ||
"core-js": "3.6.5", | ||
"crypto-js": "^4.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an md5
only package. Not sure if webpack optimizes the imported modules here, but might be better to avoid adding a bunch of functions we won't use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is specifically imported in a way utilizing tree shaking to only load the single function we need :)
IMO the privacy downside in using Gravatar client-side is small enough, it's not a script or anything. And airgapped deployments are unaffected by this PR. I've filed #3595 though to solve this server-side in due time, possibly when we finally get the |
Gravatar is nice, though I think the biggest next win will be from getting avatars of users who log in with Google. :) |
Changes
This makes it so that the user's Gravatar is used in the top right corner and user dropdown if available. If not available, Gravatar returns a 404 and the usual placeholder with the first letter of the user's name is shown.
Resolves #1474.