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

Commit

Permalink
Respect configured auth_header_logo_url for default Welcome page (#10870
Browse files Browse the repository at this point in the history
)
  • Loading branch information
t3chguy authored and richvdh committed May 12, 2023
1 parent 818eee5 commit d7f3dc6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/components/views/auth/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ export default class Welcome extends React.PureComponent<IProps> {
if (pagesConfig) {
pageUrl = pagesConfig.get("welcome_url");
}

const replaceMap: Record<string, string> = {
"$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";
}

Expand All @@ -49,16 +61,7 @@ export default class Welcome extends React.PureComponent<IProps> {
mx_WelcomePage_registrationDisabled: !SettingsStore.getValue(UIFeature.Registration),
})}
>
<EmbeddedPage
className="mx_WelcomePage"
url={pageUrl}
replaceMap={{
"$riot:ssoUrl": "#/start_sso",
"$riot:casUrl": "#/start_cas",
"$matrixLogo": MATRIX_LOGO_HTML,
"[matrix]": MATRIX_LOGO_HTML,
}}
/>
<EmbeddedPage className="mx_WelcomePage" url={pageUrl} replaceMap={replaceMap} />
<LanguageSelector />
</div>
</AuthPage>
Expand Down

0 comments on commit d7f3dc6

Please sign in to comment.