mirror of
https://github.com/logto-io/logto.git
synced 2025-02-03 21:48:55 -05:00
refactor(experience): remove the image CORS attributes (#6959)
* refactor(experience): remove the image CORS prop remove the image tag CORS property, do not check the source CORS headers * chore: add changeset add changeset * chore: fix typo fix typo * chore: update the changeset update the changeset
This commit is contained in:
parent
62562c973b
commit
d2468683c8
7 changed files with 17 additions and 40 deletions
9
.changeset/soft-kings-grin.md
Normal file
9
.changeset/soft-kings-grin.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
"@logto/experience": patch
|
||||
---
|
||||
|
||||
remove the image element's `cross-origin="anonymous"` attribute.
|
||||
|
||||
Some public image resources may not have the proper cross-origin headers configured, those images may fail to load when the `cross-origin="anonymous"` attribute is present.
|
||||
Since those image elements are only used for display purposes, Logto does not need to access the image data, so the `cross-origin="anonymous"` attribute is not necessary.
|
||||
To make the image elements more compatible with public image resources, remove the `cross-origin="anonymous"` attribute from the image elements.
|
|
@ -31,17 +31,10 @@ const BrandingHeader = ({
|
|||
{shouldShowLogo && (
|
||||
<div className={styles.logoWrapper}>
|
||||
{thirdPartyLogo && (
|
||||
<img
|
||||
className={styles.logo}
|
||||
alt="third party logo"
|
||||
src={thirdPartyLogo}
|
||||
crossOrigin="anonymous"
|
||||
/>
|
||||
<img className={styles.logo} alt="third party logo" src={thirdPartyLogo} />
|
||||
)}
|
||||
{shouldConnectSvg && <ConnectIcon className={styles.connectIcon} />}
|
||||
{logo && (
|
||||
<img className={styles.logo} alt="app logo" src={logo} crossOrigin="anonymous" />
|
||||
)}
|
||||
{logo && <img className={styles.logo} alt="app logo" src={logo} />}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
|
@ -49,12 +49,7 @@ const SocialLinkButton = ({
|
|||
onClick={onClick}
|
||||
>
|
||||
{logo && !isLoadingActive && (
|
||||
<img
|
||||
src={logo}
|
||||
alt={target}
|
||||
className={socialLinkButtonStyles.icon}
|
||||
crossOrigin="anonymous"
|
||||
/>
|
||||
<img src={logo} alt={target} className={socialLinkButtonStyles.icon} />
|
||||
)}
|
||||
{isLoadingActive && (
|
||||
<span className={socialLinkButtonStyles.loadingIcon}>
|
||||
|
|
|
@ -18,11 +18,7 @@ const SocialLanding = ({ className, connectorId, isLoading = false }: Props) =>
|
|||
return (
|
||||
<div className={classNames(styles.container, className)}>
|
||||
<div className={styles.connector}>
|
||||
{result ? (
|
||||
<img src={getConnectorLogo(result)} alt="logo" crossOrigin="anonymous" />
|
||||
) : (
|
||||
connectorId
|
||||
)}
|
||||
{result ? <img src={getConnectorLogo(result)} alt="logo" /> : connectorId}
|
||||
</div>
|
||||
{isLoading && <LoadingIcon />}
|
||||
</div>
|
||||
|
|
|
@ -31,17 +31,10 @@ const BrandingHeader = ({
|
|||
{shouldShowLogo && (
|
||||
<div className={styles.logoWrapper}>
|
||||
{thirdPartyLogo && (
|
||||
<img
|
||||
className={styles.logo}
|
||||
alt="third party logo"
|
||||
src={thirdPartyLogo}
|
||||
crossOrigin="anonymous"
|
||||
/>
|
||||
<img className={styles.logo} alt="third party logo" src={thirdPartyLogo} />
|
||||
)}
|
||||
{shouldConnectSvg && <ConnectIcon className={styles.connectIcon} />}
|
||||
{logo && (
|
||||
<img className={styles.logo} alt="app logo" src={logo} crossOrigin="anonymous" />
|
||||
)}
|
||||
{logo && <img className={styles.logo} alt="app logo" src={logo} />}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
|
@ -49,12 +49,7 @@ const SocialLinkButton = ({
|
|||
onClick={onClick}
|
||||
>
|
||||
{logo && !isLoadingActive && (
|
||||
<img
|
||||
src={logo}
|
||||
alt={target}
|
||||
className={socialLinkButtonStyles.icon}
|
||||
crossOrigin="anonymous"
|
||||
/>
|
||||
<img src={logo} alt={target} className={socialLinkButtonStyles.icon} />
|
||||
)}
|
||||
{isLoadingActive && (
|
||||
<span className={socialLinkButtonStyles.loadingIcon}>
|
||||
|
|
|
@ -18,11 +18,7 @@ const SocialLanding = ({ className, connectorId, isLoading = false }: Props) =>
|
|||
return (
|
||||
<div className={classNames(styles.container, className)}>
|
||||
<div className={styles.connector}>
|
||||
{result ? (
|
||||
<img src={getConnectorLogo(result)} alt="logo" crossOrigin="anonymous" />
|
||||
) : (
|
||||
connectorId
|
||||
)}
|
||||
{result ? <img src={getConnectorLogo(result)} alt="logo" /> : connectorId}
|
||||
</div>
|
||||
{isLoading && <LoadingIcon />}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue