From d6c87446007d6141f4a8980108f7bbb5a5fda771 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 11 May 2023 15:44:50 +0100 Subject: [PATCH] Respect configured auth_header_logo_url for default Welcome page --- src/components/views/auth/Welcome.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/views/auth/Welcome.tsx b/src/components/views/auth/Welcome.tsx index 29294f70a60..97ff8db5155 100644 --- a/src/components/views/auth/Welcome.tsx +++ b/src/components/views/auth/Welcome.tsx @@ -38,7 +38,19 @@ export default class Welcome extends React.PureComponent { if (pagesConfig) { pageUrl = pagesConfig.get("welcome_url"); } + + const replaceMap: Record = { + "$riot:ssoUrl": "#/start_sso", + "$riot:casUrl": "#/start_cas", + "$matrixLogo": MATRIX_LOGO_HTML, + "[matrix]": MATRIX_LOGO_HTML, + }; + if (!pageUrl) { + // Fall back to default and replace $logoUrl in welcome.html + const brandingConfig = SdkConfig.getObject("branding"); + const logoUrl = brandingConfig?.get("auth_header_logo_url") ?? "themes/element/img/logos/element-logo.svg"; + replaceMap["$logoUrl"] = logoUrl; pageUrl = "welcome.html"; } @@ -49,16 +61,7 @@ export default class Welcome extends React.PureComponent { mx_WelcomePage_registrationDisabled: !SettingsStore.getValue(UIFeature.Registration), })} > - +