From 4d773274d435a726c53ef4d61a1ed9eeeb2b849b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 2 Jun 2021 21:47:56 +0200 Subject: [PATCH] web: fix missing default favicon and not updating correctly Signed-off-by: Jens Langhammer --- web/src/api/Config.ts | 2 +- web/src/elements/sidebar/SidebarBrand.ts | 3 ++- web/src/pages/tenants/TenantForm.ts | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index c9761e3a9..eb2dbc3f0 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -32,7 +32,7 @@ export function tenant(): Promise { */ const rels = ["icon", "shortcut icon"]; rels.forEach(rel => { - let relIcon = document.head.querySelector("link[rel=icon]"); + let relIcon = document.head.querySelector(`link[rel='${rel}']`); if (!relIcon) { relIcon = document.createElement('link'); relIcon.rel = rel; diff --git a/web/src/elements/sidebar/SidebarBrand.ts b/web/src/elements/sidebar/SidebarBrand.ts index 2aeb132f6..c4fd296d1 100644 --- a/web/src/elements/sidebar/SidebarBrand.ts +++ b/web/src/elements/sidebar/SidebarBrand.ts @@ -16,7 +16,8 @@ import { tenant } from "../../api/Config"; export const MIN_WIDTH = 1200; export const DefaultTenant: CurrentTenant = { - brandingLogo: " /static/dist/assets/icons/icon_left_brand.svg", + brandingLogo: "/static/dist/assets/icons/icon_left_brand.svg", + brandingFavicon: "/static/dist/assets/icons/icon.png", brandingTitle: "authentik", uiFooterLinks: [], matchedDomain: "", diff --git a/web/src/pages/tenants/TenantForm.ts b/web/src/pages/tenants/TenantForm.ts index dce703b5a..0c4564ef0 100644 --- a/web/src/pages/tenants/TenantForm.ts +++ b/web/src/pages/tenants/TenantForm.ts @@ -8,6 +8,7 @@ import "../../elements/forms/FormGroup"; import { first } from "../../utils"; import { ModelForm } from "../../elements/forms/ModelForm"; import { until } from "lit-html/directives/until"; +import { DefaultTenant } from "../../elements/sidebar/SidebarBrand"; @customElement("ak-tenant-form") export class TenantForm extends ModelForm { @@ -66,21 +67,21 @@ export class TenantForm extends ModelForm { label=${t`Title`} ?required=${true} name="brandingTitle"> - +

${t`Branding shown in page title and several other places.`}

- +

${t`Icon shown in sidebar/header and flow executor.`}

- +

${t`Icon shown in the browser tab.`}