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

Commit d7f3dc6

Browse files
t3chguyrichvdh
authored andcommitted
Respect configured auth_header_logo_url for default Welcome page (#10870)
1 parent 818eee5 commit d7f3dc6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/components/views/auth/Welcome.tsx

+13-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,19 @@ export default class Welcome extends React.PureComponent<IProps> {
3838
if (pagesConfig) {
3939
pageUrl = pagesConfig.get("welcome_url");
4040
}
41+
42+
const replaceMap: Record<string, string> = {
43+
"$riot:ssoUrl": "#/start_sso",
44+
"$riot:casUrl": "#/start_cas",
45+
"$matrixLogo": MATRIX_LOGO_HTML,
46+
"[matrix]": MATRIX_LOGO_HTML,
47+
};
48+
4149
if (!pageUrl) {
50+
// Fall back to default and replace $logoUrl in welcome.html
51+
const brandingConfig = SdkConfig.getObject("branding");
52+
const logoUrl = brandingConfig?.get("auth_header_logo_url") ?? "themes/element/img/logos/element-logo.svg";
53+
replaceMap["$logoUrl"] = logoUrl;
4254
pageUrl = "welcome.html";
4355
}
4456

@@ -49,16 +61,7 @@ export default class Welcome extends React.PureComponent<IProps> {
4961
mx_WelcomePage_registrationDisabled: !SettingsStore.getValue(UIFeature.Registration),
5062
})}
5163
>
52-
<EmbeddedPage
53-
className="mx_WelcomePage"
54-
url={pageUrl}
55-
replaceMap={{
56-
"$riot:ssoUrl": "#/start_sso",
57-
"$riot:casUrl": "#/start_cas",
58-
"$matrixLogo": MATRIX_LOGO_HTML,
59-
"[matrix]": MATRIX_LOGO_HTML,
60-
}}
61-
/>
64+
<EmbeddedPage className="mx_WelcomePage" url={pageUrl} replaceMap={replaceMap} />
6265
<LanguageSelector />
6366
</div>
6467
</AuthPage>

0 commit comments

Comments
 (0)