0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00

Merge pull request #1512 from logto-io/charles-log-3570-fix-google-connector-user-avatar

fix(console): should display user avatar through google connector
This commit is contained in:
Charles Zhao 2022-07-12 17:40:19 +08:00 committed by GitHub
commit 074d455370
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,9 +91,15 @@ const UserDetails = () => {
{userId && data && (
<>
<Card className={styles.header}>
{/**
* Some social connectors like Google will block the references to its image resource,
* without specifying the referrerPolicy attribute. Reference:
* https://stackoverflow.com/questions/40570117/http403-forbidden-error-when-trying-to-load-img-src-with-google-profile-pic
*/}
<img
className={styles.avatar}
src={data.avatar || generateAvatarPlaceHolderById(userId)}
referrerPolicy="no-referrer"
/>
<div className={styles.metadata}>
<div className={styles.name}>{data.name ?? '-'}</div>