Merge pull request #5499 from matrix-org/t3chguy/msc2858.1

Social Login support both https and mxc icons
pull/21833/head
Michael Telatynski 2020-12-17 12:31:33 +00:00 committed by GitHub
commit 7bd2f2c6ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -45,8 +45,13 @@ const SSOButton: React.FC<ISSOButtonProps> = ({
};
let icon;
if (idp && idp.icon && idp.icon.startsWith("https://")) {
icon = <img src={idp.icon} height="24" width="24" alt={label} />;
if (typeof idp?.icon === "string" && (idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://"))) {
icon = <img
src={matrixClient.mxcUrlToHttp(idp.icon, 24, 24, "crop", true)}
height="24"
width="24"
alt={label}
/>;
}
const classes = classNames("mx_SSOButton", {