diff --git a/web/src/admin/sources/SourceViewPage.ts b/web/src/admin/sources/SourceViewPage.ts index d0050fdf9..3c010bdb0 100644 --- a/web/src/admin/sources/SourceViewPage.ts +++ b/web/src/admin/sources/SourceViewPage.ts @@ -14,6 +14,18 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { Source, SourcesApi } from "@goauthentik/api"; +export function renderSourceIcon(name: string, iconUrl: string | undefined | null): TemplateResult { + const icon = html``; + if (iconUrl) { + if (iconUrl.startsWith("fa://")) { + const url = iconUrl.replaceAll("fa://", ""); + return html``; + } + return html`${name}`; + } + return icon; +} + @customElement("ak-source-view") export class SourceViewPage extends AKElement { @property({ type: String }) diff --git a/web/src/flow/stages/identification/IdentificationStage.ts b/web/src/flow/stages/identification/IdentificationStage.ts index 25f407a39..a30b0c89f 100644 --- a/web/src/flow/stages/identification/IdentificationStage.ts +++ b/web/src/flow/stages/identification/IdentificationStage.ts @@ -1,3 +1,4 @@ +import { renderSourceIcon } from "@goauthentik/admin/sources/SourceViewPage"; import "@goauthentik/elements/Divider"; import "@goauthentik/elements/EmptyState"; import "@goauthentik/elements/forms/FormElement"; @@ -156,15 +157,7 @@ export class IdentificationStage extends BaseStage< } renderSource(source: LoginSource): TemplateResult { - let icon = html``; - if (source.iconUrl) { - if (source.iconUrl.startsWith("fa://")) { - const url = source.iconUrl.replaceAll("fa://", ""); - icon = html``; - } else { - icon = html`${source.name}`; - } - } + const icon = renderSourceIcon(source.name, source.iconUrl); return html`