Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7bd2f2c

Browse files
authored
Merge pull request #5499 from matrix-org/t3chguy/msc2858.1
Social Login support both https and mxc icons
2 parents 37e3c2a + 2567fcd commit 7bd2f2c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/views/elements/SSOButtons.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ const SSOButton: React.FC<ISSOButtonProps> = ({
4545
};
4646

4747
let icon;
48-
if (idp && idp.icon && idp.icon.startsWith("https://")) {
49-
icon = <img src={idp.icon} height="24" width="24" alt={label} />;
48+
if (typeof idp?.icon === "string" && (idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://"))) {
49+
icon = <img
50+
src={matrixClient.mxcUrlToHttp(idp.icon, 24, 24, "crop", true)}
51+
height="24"
52+
width="24"
53+
alt={label}
54+
/>;
5055
}
5156

5257
const classes = classNames("mx_SSOButton", {

0 commit comments

Comments
 (0)