Compare commits
	
		
			30 Commits
		
	
	
		
			fix-shared
			...
			web/config
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 79da411f10 | |||
| ce761c4337 | |||
| 0d3025794c | |||
| 79601f6d66 | |||
| 1ec0623ab6 | |||
| 4bf151cfc2 | |||
| 6752d19375 | |||
| 284c2327c6 | |||
| 600c3caa62 | |||
| 366d48eddb | |||
| e67a290b73 | |||
| 4456f085d3 | |||
| 53e982594e | |||
| def988c3b1 | |||
| e164661321 | |||
| 849fea6e91 | |||
| 24278d0781 | |||
| 8c6f83b88e | |||
| fc80596432 | |||
| 03fde51313 | |||
| f669222529 | |||
| 297c29b231 | |||
| 21b50838db | |||
| d2a9b2a343 | |||
| c52fa631b4 | |||
| 6cf2de8a7c | |||
| d4b80c17e8 | |||
| 828b8a83ea | |||
| 115e2f3dcb | |||
| 6228931305 | 
| @ -7,7 +7,7 @@ import "@goauthentik/components/ak-number-input"; | |||||||
| import "@goauthentik/components/ak-radio-input"; | import "@goauthentik/components/ak-radio-input"; | ||||||
| import "@goauthentik/components/ak-switch-input"; | import "@goauthentik/components/ak-switch-input"; | ||||||
| import "@goauthentik/components/ak-text-input"; | import "@goauthentik/components/ak-text-input"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@goauthentik/elements/forms/FormGroup"; | import "@goauthentik/elements/forms/FormGroup"; | ||||||
| import "@goauthentik/elements/forms/HorizontalFormElement"; | import "@goauthentik/elements/forms/HorizontalFormElement"; | ||||||
|  |  | ||||||
| @ -32,7 +32,7 @@ import { | |||||||
| } from "./LDAPOptionsAndHelp"; | } from "./LDAPOptionsAndHelp"; | ||||||
|  |  | ||||||
| @customElement("ak-application-wizard-authentication-by-ldap") | @customElement("ak-application-wizard-authentication-by-ldap") | ||||||
| export class ApplicationWizardApplicationDetails extends WithTenantConfig(BaseProviderPanel) { | export class ApplicationWizardApplicationDetails extends WithBrandConfig(BaseProviderPanel) { | ||||||
|     render() { |     render() { | ||||||
|         const provider = this.wizard.provider as LDAPProvider | undefined; |         const provider = this.wizard.provider as LDAPProvider | undefined; | ||||||
|         const errors = this.wizard.errors.provider; |         const errors = this.wizard.errors.provider; | ||||||
| @ -57,7 +57,7 @@ export class ApplicationWizardApplicationDetails extends WithTenantConfig(BasePr | |||||||
|                     <ak-tenanted-flow-search |                     <ak-tenanted-flow-search | ||||||
|                         flowType=${FlowsInstancesListDesignationEnum.Authentication} |                         flowType=${FlowsInstancesListDesignationEnum.Authentication} | ||||||
|                         .currentFlow=${provider?.authorizationFlow} |                         .currentFlow=${provider?.authorizationFlow} | ||||||
|                         .tenantFlow=${this.tenant.flowAuthentication} |                         .tenantFlow=${this.brand.flowAuthentication} | ||||||
|                         required |                         required | ||||||
|                     ></ak-tenanted-flow-search> |                     ></ak-tenanted-flow-search> | ||||||
|                     <p class="pf-c-form__helper-text"> |                     <p class="pf-c-form__helper-text"> | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ import "@goauthentik/admin/common/ak-crypto-certificate-search"; | |||||||
| import "@goauthentik/admin/common/ak-flow-search/ak-tenanted-flow-search"; | import "@goauthentik/admin/common/ak-flow-search/ak-tenanted-flow-search"; | ||||||
| import { ascii_letters, digits, first, randomString } from "@goauthentik/common/utils"; | import { ascii_letters, digits, first, randomString } from "@goauthentik/common/utils"; | ||||||
| import "@goauthentik/components/ak-text-input"; | import "@goauthentik/components/ak-text-input"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@goauthentik/elements/forms/FormGroup"; | import "@goauthentik/elements/forms/FormGroup"; | ||||||
| import "@goauthentik/elements/forms/HorizontalFormElement"; | import "@goauthentik/elements/forms/HorizontalFormElement"; | ||||||
|  |  | ||||||
| @ -17,7 +17,7 @@ import { FlowsInstancesListDesignationEnum, RadiusProvider } from "@goauthentik/ | |||||||
| import BaseProviderPanel from "../BaseProviderPanel"; | import BaseProviderPanel from "../BaseProviderPanel"; | ||||||
|  |  | ||||||
| @customElement("ak-application-wizard-authentication-by-radius") | @customElement("ak-application-wizard-authentication-by-radius") | ||||||
| export class ApplicationWizardAuthenticationByRadius extends WithTenantConfig(BaseProviderPanel) { | export class ApplicationWizardAuthenticationByRadius extends WithBrandConfig(BaseProviderPanel) { | ||||||
|     render() { |     render() { | ||||||
|         const provider = this.wizard.provider as RadiusProvider | undefined; |         const provider = this.wizard.provider as RadiusProvider | undefined; | ||||||
|         const errors = this.wizard.errors.provider; |         const errors = this.wizard.errors.provider; | ||||||
| @ -42,7 +42,7 @@ export class ApplicationWizardAuthenticationByRadius extends WithTenantConfig(Ba | |||||||
|                     <ak-tenanted-flow-search |                     <ak-tenanted-flow-search | ||||||
|                         flowType=${FlowsInstancesListDesignationEnum.Authentication} |                         flowType=${FlowsInstancesListDesignationEnum.Authentication} | ||||||
|                         .currentFlow=${provider?.authorizationFlow} |                         .currentFlow=${provider?.authorizationFlow} | ||||||
|                         .tenantFlow=${this.tenant.flowAuthentication} |                         .tenantFlow=${this.brand.flowAuthentication} | ||||||
|                         required |                         required | ||||||
|                     ></ak-tenanted-flow-search> |                     ></ak-tenanted-flow-search> | ||||||
|                     <p class="pf-c-form__helper-text"> |                     <p class="pf-c-form__helper-text"> | ||||||
|  | |||||||
| @ -9,11 +9,11 @@ import { MessageLevel } from "@goauthentik/common/messages"; | |||||||
| import { uiConfig } from "@goauthentik/common/ui/config"; | import { uiConfig } from "@goauthentik/common/ui/config"; | ||||||
| import { first } from "@goauthentik/common/utils"; | import { first } from "@goauthentik/common/utils"; | ||||||
| import "@goauthentik/components/ak-status-label"; | import "@goauthentik/components/ak-status-label"; | ||||||
|  | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import { | import { | ||||||
|     CapabilitiesEnum, |     CapabilitiesEnum, | ||||||
|     WithCapabilitiesConfig, |     WithCapabilitiesConfig, | ||||||
| } from "@goauthentik/elements/Interface/capabilitiesProvider"; | } from "@goauthentik/elements/Interface/capabilitiesProvider"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; |  | ||||||
| import "@goauthentik/elements/buttons/ActionButton"; | import "@goauthentik/elements/buttons/ActionButton"; | ||||||
| import "@goauthentik/elements/buttons/Dropdown"; | import "@goauthentik/elements/buttons/Dropdown"; | ||||||
| import "@goauthentik/elements/forms/DeleteBulkForm"; | import "@goauthentik/elements/forms/DeleteBulkForm"; | ||||||
| @ -110,7 +110,7 @@ export class RelatedUserAdd extends Form<{ users: number[] }> { | |||||||
| } | } | ||||||
|  |  | ||||||
| @customElement("ak-user-related-list") | @customElement("ak-user-related-list") | ||||||
| export class RelatedUserList extends WithTenantConfig(WithCapabilitiesConfig(Table<User>)) { | export class RelatedUserList extends WithBrandConfig(WithCapabilitiesConfig(Table<User>)) { | ||||||
|     expandable = true; |     expandable = true; | ||||||
|     checkbox = true; |     checkbox = true; | ||||||
|  |  | ||||||
| @ -295,7 +295,7 @@ export class RelatedUserList extends WithTenantConfig(WithCapabilitiesConfig(Tab | |||||||
|                                             ${msg("Set password")} |                                             ${msg("Set password")} | ||||||
|                                         </button> |                                         </button> | ||||||
|                                     </ak-forms-modal> |                                     </ak-forms-modal> | ||||||
|                                     ${this.tenant?.flowRecovery |                                     ${this.brand?.flowRecovery | ||||||
|                                         ? html` |                                         ? html` | ||||||
|                                               <ak-action-button |                                               <ak-action-button | ||||||
|                                                   class="pf-m-secondary" |                                                   class="pf-m-secondary" | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ import "@goauthentik/admin/common/ak-flow-search/ak-tenanted-flow-search"; | |||||||
| import { BaseProviderForm } from "@goauthentik/admin/providers/BaseProviderForm"; | import { BaseProviderForm } from "@goauthentik/admin/providers/BaseProviderForm"; | ||||||
| import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | ||||||
| import { first } from "@goauthentik/common/utils"; | import { first } from "@goauthentik/common/utils"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@goauthentik/elements/forms/FormGroup"; | import "@goauthentik/elements/forms/FormGroup"; | ||||||
| import "@goauthentik/elements/forms/HorizontalFormElement"; | import "@goauthentik/elements/forms/HorizontalFormElement"; | ||||||
| import "@goauthentik/elements/forms/Radio"; | import "@goauthentik/elements/forms/Radio"; | ||||||
| @ -25,7 +25,7 @@ import { | |||||||
| } from "@goauthentik/api"; | } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| @customElement("ak-provider-ldap-form") | @customElement("ak-provider-ldap-form") | ||||||
| export class LDAPProviderFormPage extends WithTenantConfig(BaseProviderForm<LDAPProvider>) { | export class LDAPProviderFormPage extends WithBrandConfig(BaseProviderForm<LDAPProvider>) { | ||||||
|     async loadInstance(pk: number): Promise<LDAPProvider> { |     async loadInstance(pk: number): Promise<LDAPProvider> { | ||||||
|         return new ProvidersApi(DEFAULT_CONFIG).providersLdapRetrieve({ |         return new ProvidersApi(DEFAULT_CONFIG).providersLdapRetrieve({ | ||||||
|             id: pk, |             id: pk, | ||||||
| @ -68,7 +68,7 @@ export class LDAPProviderFormPage extends WithTenantConfig(BaseProviderForm<LDAP | |||||||
|                 <ak-tenanted-flow-search |                 <ak-tenanted-flow-search | ||||||
|                     flowType=${FlowsInstancesListDesignationEnum.Authentication} |                     flowType=${FlowsInstancesListDesignationEnum.Authentication} | ||||||
|                     .currentFlow=${this.instance?.authorizationFlow} |                     .currentFlow=${this.instance?.authorizationFlow} | ||||||
|                     .tenantFlow=${this.tenant?.flowAuthentication} |                     .tenantFlow=${this.brand?.flowAuthentication} | ||||||
|                     required |                     required | ||||||
|                 ></ak-tenanted-flow-search> |                 ></ak-tenanted-flow-search> | ||||||
|                 <p class="pf-c-form__helper-text">${msg("Flow used for users to authenticate.")}</p> |                 <p class="pf-c-form__helper-text">${msg("Flow used for users to authenticate.")}</p> | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| import { BaseProviderForm } from "@goauthentik/admin/providers/BaseProviderForm"; | import { BaseProviderForm } from "@goauthentik/admin/providers/BaseProviderForm"; | ||||||
| import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | ||||||
| import { ascii_letters, digits, first, randomString } from "@goauthentik/common/utils"; | import { ascii_letters, digits, first, randomString } from "@goauthentik/common/utils"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@goauthentik/elements/forms/FormGroup"; | import "@goauthentik/elements/forms/FormGroup"; | ||||||
| import "@goauthentik/elements/forms/HorizontalFormElement"; | import "@goauthentik/elements/forms/HorizontalFormElement"; | ||||||
| import "@goauthentik/elements/forms/SearchSelect"; | import "@goauthentik/elements/forms/SearchSelect"; | ||||||
| @ -14,7 +14,7 @@ import { customElement } from "lit/decorators.js"; | |||||||
| import { FlowsInstancesListDesignationEnum, ProvidersApi, RadiusProvider } from "@goauthentik/api"; | import { FlowsInstancesListDesignationEnum, ProvidersApi, RadiusProvider } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| @customElement("ak-provider-radius-form") | @customElement("ak-provider-radius-form") | ||||||
| export class RadiusProviderFormPage extends WithTenantConfig(BaseProviderForm<RadiusProvider>) { | export class RadiusProviderFormPage extends WithBrandConfig(BaseProviderForm<RadiusProvider>) { | ||||||
|     loadInstance(pk: number): Promise<RadiusProvider> { |     loadInstance(pk: number): Promise<RadiusProvider> { | ||||||
|         return new ProvidersApi(DEFAULT_CONFIG).providersRadiusRetrieve({ |         return new ProvidersApi(DEFAULT_CONFIG).providersRadiusRetrieve({ | ||||||
|             id: pk, |             id: pk, | ||||||
| @ -57,7 +57,7 @@ export class RadiusProviderFormPage extends WithTenantConfig(BaseProviderForm<Ra | |||||||
|                 <ak-tenanted-flow-search |                 <ak-tenanted-flow-search | ||||||
|                     flowType=${FlowsInstancesListDesignationEnum.Authentication} |                     flowType=${FlowsInstancesListDesignationEnum.Authentication} | ||||||
|                     .currentFlow=${this.instance?.authorizationFlow} |                     .currentFlow=${this.instance?.authorizationFlow} | ||||||
|                     .tenantFlow=${this.tenant?.flowAuthentication} |                     .tenantFlow=${this.brand?.flowAuthentication} | ||||||
|                     required |                     required | ||||||
|                 ></ak-tenanted-flow-search> |                 ></ak-tenanted-flow-search> | ||||||
|                 <p class="pf-c-form__helper-text">${msg("Flow used for users to authenticate.")}</p> |                 <p class="pf-c-form__helper-text">${msg("Flow used for users to authenticate.")}</p> | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import "@goauthentik/elements/forms/FormGroup"; | |||||||
| import "@goauthentik/elements/forms/HorizontalFormElement"; | import "@goauthentik/elements/forms/HorizontalFormElement"; | ||||||
| import { ModelForm } from "@goauthentik/elements/forms/ModelForm"; | import { ModelForm } from "@goauthentik/elements/forms/ModelForm"; | ||||||
| import "@goauthentik/elements/forms/SearchSelect"; | import "@goauthentik/elements/forms/SearchSelect"; | ||||||
| import { DefaultTenant } from "@goauthentik/elements/sidebar/SidebarBrand"; | import { DefaultBrand } from "@goauthentik/elements/sidebar/SidebarBrand"; | ||||||
| import YAML from "yaml"; | import YAML from "yaml"; | ||||||
|  |  | ||||||
| import { msg } from "@lit/localize"; | import { msg } from "@lit/localize"; | ||||||
| @ -93,7 +93,7 @@ export class TenantForm extends ModelForm<Tenant, string> { | |||||||
|                             type="text" |                             type="text" | ||||||
|                             value="${first( |                             value="${first( | ||||||
|                                 this.instance?.brandingTitle, |                                 this.instance?.brandingTitle, | ||||||
|                                 DefaultTenant.brandingTitle, |                                 DefaultBrand.brandingTitle, | ||||||
|                             )}" |                             )}" | ||||||
|                             class="pf-c-form-control" |                             class="pf-c-form-control" | ||||||
|                             required |                             required | ||||||
| @ -109,10 +109,7 @@ export class TenantForm extends ModelForm<Tenant, string> { | |||||||
|                     > |                     > | ||||||
|                         <input |                         <input | ||||||
|                             type="text" |                             type="text" | ||||||
|                             value="${first( |                             value="${first(this.instance?.brandingLogo, DefaultBrand.brandingLogo)}" | ||||||
|                                 this.instance?.brandingLogo, |  | ||||||
|                                 DefaultTenant.brandingLogo, |  | ||||||
|                             )}" |  | ||||||
|                             class="pf-c-form-control" |                             class="pf-c-form-control" | ||||||
|                             required |                             required | ||||||
|                         /> |                         /> | ||||||
| @ -129,7 +126,7 @@ export class TenantForm extends ModelForm<Tenant, string> { | |||||||
|                             type="text" |                             type="text" | ||||||
|                             value="${first( |                             value="${first( | ||||||
|                                 this.instance?.brandingFavicon, |                                 this.instance?.brandingFavicon, | ||||||
|                                 DefaultTenant.brandingFavicon, |                                 DefaultBrand.brandingFavicon, | ||||||
|                             )}" |                             )}" | ||||||
|                             class="pf-c-form-control" |                             class="pf-c-form-control" | ||||||
|                             required |                             required | ||||||
|  | |||||||
| @ -12,11 +12,11 @@ import { DefaultUIConfig, uiConfig } from "@goauthentik/common/ui/config"; | |||||||
| import { first } from "@goauthentik/common/utils"; | import { first } from "@goauthentik/common/utils"; | ||||||
| import "@goauthentik/components/ak-status-label"; | import "@goauthentik/components/ak-status-label"; | ||||||
| import { rootInterface } from "@goauthentik/elements/Base"; | import { rootInterface } from "@goauthentik/elements/Base"; | ||||||
|  | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import { | import { | ||||||
|     CapabilitiesEnum, |     CapabilitiesEnum, | ||||||
|     WithCapabilitiesConfig, |     WithCapabilitiesConfig, | ||||||
| } from "@goauthentik/elements/Interface/capabilitiesProvider"; | } from "@goauthentik/elements/Interface/capabilitiesProvider"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; |  | ||||||
| import { PFSize } from "@goauthentik/elements/Spinner"; | import { PFSize } from "@goauthentik/elements/Spinner"; | ||||||
| import "@goauthentik/elements/TreeView"; | import "@goauthentik/elements/TreeView"; | ||||||
| import "@goauthentik/elements/buttons/ActionButton"; | import "@goauthentik/elements/buttons/ActionButton"; | ||||||
| @ -91,7 +91,7 @@ const recoveryButtonStyles = css` | |||||||
| `; | `; | ||||||
|  |  | ||||||
| @customElement("ak-user-list") | @customElement("ak-user-list") | ||||||
| export class UserListPage extends WithTenantConfig(WithCapabilitiesConfig(TablePage<User>)) { | export class UserListPage extends WithBrandConfig(WithCapabilitiesConfig(TablePage<User>)) { | ||||||
|     expandable = true; |     expandable = true; | ||||||
|     checkbox = true; |     checkbox = true; | ||||||
|  |  | ||||||
| @ -352,7 +352,7 @@ export class UserListPage extends WithTenantConfig(WithCapabilitiesConfig(TableP | |||||||
|                                             ${msg("Set password")} |                                             ${msg("Set password")} | ||||||
|                                         </button> |                                         </button> | ||||||
|                                     </ak-forms-modal> |                                     </ak-forms-modal> | ||||||
|                                     ${this.tenant.flowRecovery |                                     ${this.brand.flowRecovery | ||||||
|                                         ? html` |                                         ? html` | ||||||
|                                               <ak-action-button |                                               <ak-action-button | ||||||
|                                                   class="pf-m-secondary" |                                                   class="pf-m-secondary" | ||||||
|  | |||||||
| @ -6,7 +6,13 @@ import { | |||||||
| import { EVENT_LOCALE_REQUEST, EVENT_REFRESH, VERSION } from "@goauthentik/common/constants"; | import { EVENT_LOCALE_REQUEST, EVENT_REFRESH, VERSION } from "@goauthentik/common/constants"; | ||||||
| import { globalAK } from "@goauthentik/common/global"; | import { globalAK } from "@goauthentik/common/global"; | ||||||
|  |  | ||||||
| import { Config, Configuration, CoreApi, CurrentTenant, RootApi } from "@goauthentik/api"; | import { | ||||||
|  |     Config, | ||||||
|  |     Configuration, | ||||||
|  |     CoreApi, | ||||||
|  |     CurrentTenant as CurrentBrand, | ||||||
|  |     RootApi, | ||||||
|  | } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| let globalConfigPromise: Promise<Config> | undefined = Promise.resolve(globalAK().config); | let globalConfigPromise: Promise<Config> | undefined = Promise.resolve(globalAK().config); | ||||||
| export function config(): Promise<Config> { | export function config(): Promise<Config> { | ||||||
| @ -16,7 +22,7 @@ export function config(): Promise<Config> { | |||||||
|     return globalConfigPromise; |     return globalConfigPromise; | ||||||
| } | } | ||||||
|  |  | ||||||
| export function tenantSetFavicon(tenant: CurrentTenant) { | export function brandSetFavicon(brand: CurrentBrand) { | ||||||
|     /** |     /** | ||||||
|      *  <link rel="icon" href="/static/dist/assets/icons/icon.png"> |      *  <link rel="icon" href="/static/dist/assets/icons/icon.png"> | ||||||
|      *  <link rel="shortcut icon" href="/static/dist/assets/icons/icon.png"> |      *  <link rel="shortcut icon" href="/static/dist/assets/icons/icon.png"> | ||||||
| @ -29,36 +35,36 @@ export function tenantSetFavicon(tenant: CurrentTenant) { | |||||||
|             relIcon.rel = rel; |             relIcon.rel = rel; | ||||||
|             document.getElementsByTagName("head")[0].appendChild(relIcon); |             document.getElementsByTagName("head")[0].appendChild(relIcon); | ||||||
|         } |         } | ||||||
|         relIcon.href = tenant.brandingFavicon; |         relIcon.href = brand.brandingFavicon; | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| export function tenantSetLocale(tenant: CurrentTenant) { | export function brandSetLocale(brand: CurrentBrand) { | ||||||
|     if (tenant.defaultLocale === "") { |     if (brand.defaultLocale === "") { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     console.debug("authentik/locale: setting locale from tenant default"); |     console.debug("authentik/locale: setting locale from brand default"); | ||||||
|     window.dispatchEvent( |     window.dispatchEvent( | ||||||
|         new CustomEvent(EVENT_LOCALE_REQUEST, { |         new CustomEvent(EVENT_LOCALE_REQUEST, { | ||||||
|             composed: true, |             composed: true, | ||||||
|             bubbles: true, |             bubbles: true, | ||||||
|             detail: { locale: tenant.defaultLocale }, |             detail: { locale: brand.defaultLocale }, | ||||||
|         }), |         }), | ||||||
|     ); |     ); | ||||||
| } | } | ||||||
|  |  | ||||||
| let globalTenantPromise: Promise<CurrentTenant> | undefined = Promise.resolve(globalAK().tenant); | let globalBrandPromise: Promise<CurrentBrand> | undefined = Promise.resolve(globalAK().tenant); | ||||||
| export function tenant(): Promise<CurrentTenant> { | export function brand(): Promise<CurrentBrand> { | ||||||
|     if (!globalTenantPromise) { |     if (!globalBrandPromise) { | ||||||
|         globalTenantPromise = new CoreApi(DEFAULT_CONFIG) |         globalBrandPromise = new CoreApi(DEFAULT_CONFIG) | ||||||
|             .coreTenantsCurrentRetrieve() |             .coreTenantsCurrentRetrieve() | ||||||
|             .then((tenant) => { |             .then((brand) => { | ||||||
|                 tenantSetFavicon(tenant); |                 brandSetFavicon(brand); | ||||||
|                 tenantSetLocale(tenant); |                 brandSetLocale(brand); | ||||||
|                 return tenant; |                 return brand; | ||||||
|             }); |             }); | ||||||
|     } |     } | ||||||
|     return globalTenantPromise; |     return globalBrandPromise; | ||||||
| } | } | ||||||
|  |  | ||||||
| export function getMetaContent(key: string): string { | export function getMetaContent(key: string): string { | ||||||
| @ -90,9 +96,9 @@ window.addEventListener(EVENT_REFRESH, () => { | |||||||
|     // Upon global refresh, disregard whatever was pre-hydrated and |     // Upon global refresh, disregard whatever was pre-hydrated and | ||||||
|     // actually load info from API |     // actually load info from API | ||||||
|     globalConfigPromise = undefined; |     globalConfigPromise = undefined; | ||||||
|     globalTenantPromise = undefined; |     globalBrandPromise = undefined; | ||||||
|     config(); |     config(); | ||||||
|     tenant(); |     brand(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| console.debug(`authentik(early): version ${VERSION}, apiBase ${DEFAULT_CONFIG.basePath}`); | console.debug(`authentik(early): version ${VERSION}, apiBase ${DEFAULT_CONFIG.basePath}`); | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ import { EVENT_REQUEST_POST } from "@goauthentik/common/constants"; | |||||||
| import { getCookie } from "@goauthentik/common/utils"; | import { getCookie } from "@goauthentik/common/utils"; | ||||||
|  |  | ||||||
| import { | import { | ||||||
|     CurrentTenant, |     CurrentTenant as CurrentBrand, | ||||||
|     FetchParams, |     FetchParams, | ||||||
|     Middleware, |     Middleware, | ||||||
|     RequestContext, |     RequestContext, | ||||||
| @ -18,13 +18,13 @@ export interface RequestInfo { | |||||||
| } | } | ||||||
|  |  | ||||||
| export class LoggingMiddleware implements Middleware { | export class LoggingMiddleware implements Middleware { | ||||||
|     tenant: CurrentTenant; |     brand: CurrentBrand; | ||||||
|     constructor(tenant: CurrentTenant) { |     constructor(brand: CurrentBrand) { | ||||||
|         this.tenant = tenant; |         this.brand = brand; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     post(context: ResponseContext): Promise<Response | void> { |     post(context: ResponseContext): Promise<Response | void> { | ||||||
|         let msg = `authentik/api[${this.tenant.matchedDomain}]: `; |         let msg = `authentik/api[${this.brand.matchedDomain}]: `; | ||||||
|         // https://developer.mozilla.org/en-US/docs/Web/API/console#styling_console_output |         // https://developer.mozilla.org/en-US/docs/Web/API/console#styling_console_output | ||||||
|         msg += `%c${context.response.status}%c ${context.init.method} ${context.url}`; |         msg += `%c${context.response.status}%c ${context.init.method} ${context.url}`; | ||||||
|         let style = ""; |         let style = ""; | ||||||
|  | |||||||
| @ -1,11 +1,9 @@ | |||||||
| import { createContext } from "@lit-labs/context"; | import { createContext } from "@lit-labs/context"; | ||||||
|  |  | ||||||
| import type { Config, CurrentTenant } from "@goauthentik/api"; | import type { Config, CurrentTenant as CurrentBrand } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| export const authentikConfigContext = createContext<Config>(Symbol("authentik-config-context")); | export const authentikConfigContext = createContext<Config>(Symbol("authentik-config-context")); | ||||||
|  |  | ||||||
| export const authentikTenantContext = createContext<CurrentTenant>( | export const authentikBrandContext = createContext<CurrentBrand>(Symbol("authentik-brand-context")); | ||||||
|     Symbol("authentik-tenant-context"), |  | ||||||
| ); |  | ||||||
|  |  | ||||||
| export default authentikConfigContext; | export default authentikConfigContext; | ||||||
|  | |||||||
| @ -9,13 +9,13 @@ import { LitElement } from "lit"; | |||||||
| import AKGlobal from "@goauthentik/common/styles/authentik.css"; | import AKGlobal from "@goauthentik/common/styles/authentik.css"; | ||||||
| import ThemeDark from "@goauthentik/common/styles/theme-dark.css"; | import ThemeDark from "@goauthentik/common/styles/theme-dark.css"; | ||||||
|  |  | ||||||
| import { Config, CurrentTenant, UiThemeEnum } from "@goauthentik/api"; | import { Config, CurrentTenant as CurrentBrand, UiThemeEnum } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| import { AdoptedStyleSheetsElement } from "./types"; | import { AdoptedStyleSheetsElement } from "./types"; | ||||||
|  |  | ||||||
| type AkInterface = HTMLElement & { | type AkInterface = HTMLElement & { | ||||||
|     getTheme: () => Promise<UiThemeEnum>; |     getTheme: () => Promise<UiThemeEnum>; | ||||||
|     tenant?: CurrentTenant; |     brand?: CurrentBrand; | ||||||
|     uiConfig?: UIConfig; |     uiConfig?: UIConfig; | ||||||
|     config?: Config; |     config?: Config; | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| import { config, tenant } from "@goauthentik/common/api/config"; | import { brand, config } from "@goauthentik/common/api/config"; | ||||||
| import { UIConfig, uiConfig } from "@goauthentik/common/ui/config"; | import { UIConfig, uiConfig } from "@goauthentik/common/ui/config"; | ||||||
| import { | import { | ||||||
|  |     authentikBrandContext, | ||||||
|     authentikConfigContext, |     authentikConfigContext, | ||||||
|     authentikTenantContext, |  | ||||||
| } from "@goauthentik/elements/AuthentikContexts"; | } from "@goauthentik/elements/AuthentikContexts"; | ||||||
| import type { AdoptedStyleSheetsElement } from "@goauthentik/elements/types"; | import type { AdoptedStyleSheetsElement } from "@goauthentik/elements/types"; | ||||||
| import { ensureCSSStyleSheet } from "@goauthentik/elements/utils/ensureCSSStyleSheet"; | import { ensureCSSStyleSheet } from "@goauthentik/elements/utils/ensureCSSStyleSheet"; | ||||||
| @ -12,13 +12,13 @@ import { state } from "lit/decorators.js"; | |||||||
|  |  | ||||||
| import PFBase from "@patternfly/patternfly/patternfly-base.css"; | import PFBase from "@patternfly/patternfly/patternfly-base.css"; | ||||||
|  |  | ||||||
| import { Config, CurrentTenant, UiThemeEnum } from "@goauthentik/api"; | import { Config, CurrentTenant as CurrentBrand, UiThemeEnum } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| import { AKElement } from "../Base"; | import { AKElement } from "../Base"; | ||||||
|  |  | ||||||
| type AkInterface = HTMLElement & { | type AkInterface = HTMLElement & { | ||||||
|     getTheme: () => Promise<UiThemeEnum>; |     getTheme: () => Promise<UiThemeEnum>; | ||||||
|     tenant?: CurrentTenant; |     brand?: CurrentBrand; | ||||||
|     uiConfig?: UIConfig; |     uiConfig?: UIConfig; | ||||||
|     config?: Config; |     config?: Config; | ||||||
| }; | }; | ||||||
| @ -45,28 +45,28 @@ export class Interface extends AKElement implements AkInterface { | |||||||
|         return this._config; |         return this._config; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     _tenantContext = new ContextProvider(this, { |     _brandContext = new ContextProvider(this, { | ||||||
|         context: authentikTenantContext, |         context: authentikBrandContext, | ||||||
|         initialValue: undefined, |         initialValue: undefined, | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     _tenant?: CurrentTenant; |     _brand?: CurrentBrand; | ||||||
|  |  | ||||||
|     @state() |     @state() | ||||||
|     set tenant(c: CurrentTenant) { |     set brand(c: CurrentBrand) { | ||||||
|         this._tenant = c; |         this._brand = c; | ||||||
|         this._tenantContext.setValue(c); |         this._brandContext.setValue(c); | ||||||
|         this.requestUpdate(); |         this.requestUpdate(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     get tenant(): CurrentTenant | undefined { |     get brand(): CurrentBrand | undefined { | ||||||
|         return this._tenant; |         return this._brand; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     constructor() { |     constructor() { | ||||||
|         super(); |         super(); | ||||||
|         document.adoptedStyleSheets = [...document.adoptedStyleSheets, ensureCSSStyleSheet(PFBase)]; |         document.adoptedStyleSheets = [...document.adoptedStyleSheets, ensureCSSStyleSheet(PFBase)]; | ||||||
|         tenant().then((tenant) => (this.tenant = tenant)); |         brand().then((brand) => (this.brand = brand)); | ||||||
|         config().then((config) => (this.config = config)); |         config().then((config) => (this.config = config)); | ||||||
|         this.dataset.akInterfaceRoot = "true"; |         this.dataset.akInterfaceRoot = "true"; | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										20
									
								
								web/src/elements/Interface/brandProvider.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								web/src/elements/Interface/brandProvider.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | |||||||
|  | import { authentikBrandContext } from "@goauthentik/elements/AuthentikContexts"; | ||||||
|  |  | ||||||
|  | import { consume } from "@lit-labs/context"; | ||||||
|  | import type { LitElement } from "lit"; | ||||||
|  |  | ||||||
|  | import type { CurrentTenant as CurrentBrand } from "@goauthentik/api"; | ||||||
|  |  | ||||||
|  | // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
|  | type Constructor<T = object> = abstract new (...args: any[]) => T; | ||||||
|  |  | ||||||
|  | export function WithBrandConfig<T extends Constructor<LitElement>>( | ||||||
|  |     superclass: T, | ||||||
|  |     subscribe = true, | ||||||
|  | ) { | ||||||
|  |     abstract class WithBrandProvider extends superclass { | ||||||
|  |         @consume({ context: authentikBrandContext, subscribe }) | ||||||
|  |         public brand!: CurrentBrand; | ||||||
|  |     } | ||||||
|  |     return WithBrandProvider; | ||||||
|  | } | ||||||
| @ -1,20 +0,0 @@ | |||||||
| import { authentikTenantContext } from "@goauthentik/elements/AuthentikContexts"; |  | ||||||
|  |  | ||||||
| import { consume } from "@lit-labs/context"; |  | ||||||
| import type { LitElement } from "lit"; |  | ||||||
|  |  | ||||||
| import type { CurrentTenant } from "@goauthentik/api"; |  | ||||||
|  |  | ||||||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any |  | ||||||
| type Constructor<T = object> = abstract new (...args: any[]) => T; |  | ||||||
|  |  | ||||||
| export function WithTenantConfig<T extends Constructor<LitElement>>( |  | ||||||
|     superclass: T, |  | ||||||
|     subscribe = true, |  | ||||||
| ) { |  | ||||||
|     abstract class WithTenantProvider extends superclass { |  | ||||||
|         @consume({ context: authentikTenantContext, subscribe }) |  | ||||||
|         public tenant!: CurrentTenant; |  | ||||||
|     } |  | ||||||
|     return WithTenantProvider; |  | ||||||
| } |  | ||||||
| @ -9,7 +9,7 @@ import { | |||||||
| import { currentInterface } from "@goauthentik/common/sentry"; | import { currentInterface } from "@goauthentik/common/sentry"; | ||||||
| import { me } from "@goauthentik/common/users"; | import { me } from "@goauthentik/common/users"; | ||||||
| import { AKElement } from "@goauthentik/elements/Base"; | import { AKElement } from "@goauthentik/elements/Base"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@patternfly/elements/pf-tooltip/pf-tooltip.js"; | import "@patternfly/elements/pf-tooltip/pf-tooltip.js"; | ||||||
|  |  | ||||||
| import { msg } from "@lit/localize"; | import { msg } from "@lit/localize"; | ||||||
| @ -24,7 +24,7 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; | |||||||
| import { EventsApi } from "@goauthentik/api"; | import { EventsApi } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| @customElement("ak-page-header") | @customElement("ak-page-header") | ||||||
| export class PageHeader extends WithTenantConfig(AKElement) { | export class PageHeader extends WithBrandConfig(AKElement) { | ||||||
|     @property() |     @property() | ||||||
|     icon?: string; |     icon?: string; | ||||||
|  |  | ||||||
| @ -37,7 +37,7 @@ export class PageHeader extends WithTenantConfig(AKElement) { | |||||||
|     @property() |     @property() | ||||||
|     set header(value: string) { |     set header(value: string) { | ||||||
|         const currentIf = currentInterface(); |         const currentIf = currentInterface(); | ||||||
|         let title = this.tenant?.brandingTitle || TITLE_DEFAULT; |         let title = this.brand?.brandingTitle || TITLE_DEFAULT; | ||||||
|         if (currentIf === "admin") { |         if (currentIf === "admin") { | ||||||
|             title = `${msg("Admin")} - ${title}`; |             title = `${msg("Admin")} - ${title}`; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import { EVENT_SIDEBAR_TOGGLE } from "@goauthentik/common/constants"; | import { EVENT_SIDEBAR_TOGGLE } from "@goauthentik/common/constants"; | ||||||
| import { AKElement } from "@goauthentik/elements/Base"; | import { AKElement } from "@goauthentik/elements/Base"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
|  |  | ||||||
| import { CSSResult, TemplateResult, css, html } from "lit"; | import { CSSResult, TemplateResult, css, html } from "lit"; | ||||||
| import { customElement } from "lit/decorators.js"; | import { customElement } from "lit/decorators.js"; | ||||||
| @ -10,13 +10,13 @@ import PFPage from "@patternfly/patternfly/components/Page/page.css"; | |||||||
| import PFGlobal from "@patternfly/patternfly/patternfly-base.css"; | import PFGlobal from "@patternfly/patternfly/patternfly-base.css"; | ||||||
| import PFBase from "@patternfly/patternfly/patternfly-base.css"; | import PFBase from "@patternfly/patternfly/patternfly-base.css"; | ||||||
|  |  | ||||||
| import { CurrentTenant, UiThemeEnum } from "@goauthentik/api"; | import { CurrentTenant as CurrentBrand, UiThemeEnum } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| // If the viewport is wider than MIN_WIDTH, the sidebar | // If the viewport is wider than MIN_WIDTH, the sidebar | ||||||
| // is shown besides the content, and not overlaid. | // is shown besides the content, and not overlaid. | ||||||
| export const MIN_WIDTH = 1200; | export const MIN_WIDTH = 1200; | ||||||
|  |  | ||||||
| export const DefaultTenant: CurrentTenant = { | export const DefaultBrand: CurrentBrand = { | ||||||
|     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", |     brandingFavicon: "/static/dist/assets/icons/icon.png", | ||||||
|     brandingTitle: "authentik", |     brandingTitle: "authentik", | ||||||
| @ -27,7 +27,7 @@ export const DefaultTenant: CurrentTenant = { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| @customElement("ak-sidebar-brand") | @customElement("ak-sidebar-brand") | ||||||
| export class SidebarBrand extends WithTenantConfig(AKElement) { | export class SidebarBrand extends WithBrandConfig(AKElement) { | ||||||
|     static get styles(): CSSResult[] { |     static get styles(): CSSResult[] { | ||||||
|         return [ |         return [ | ||||||
|             PFBase, |             PFBase, | ||||||
| @ -65,6 +65,7 @@ export class SidebarBrand extends WithTenantConfig(AKElement) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     render(): TemplateResult { |     render(): TemplateResult { | ||||||
|  |         console.log(this.brand); | ||||||
|         return html` ${window.innerWidth <= MIN_WIDTH |         return html` ${window.innerWidth <= MIN_WIDTH | ||||||
|                 ? html` |                 ? html` | ||||||
|                       <button |                       <button | ||||||
| @ -85,7 +86,7 @@ export class SidebarBrand extends WithTenantConfig(AKElement) { | |||||||
|             <a href="#/" class="pf-c-page__header-brand-link"> |             <a href="#/" class="pf-c-page__header-brand-link"> | ||||||
|                 <div class="pf-c-brand ak-brand"> |                 <div class="pf-c-brand ak-brand"> | ||||||
|                     <img |                     <img | ||||||
|                         src=${this.tenant?.brandingLogo ?? DefaultTenant.brandingLogo} |                         src=${this.brand?.brandingLogo ?? DefaultBrand.brandingLogo} | ||||||
|                         alt="authentik Logo" |                         alt="authentik Logo" | ||||||
|                         loading="lazy" |                         loading="lazy" | ||||||
|                     /> |                     /> | ||||||
|  | |||||||
| @ -205,7 +205,7 @@ export class RacInterface extends Interface { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     updateTitle(): void { |     updateTitle(): void { | ||||||
|         let title = this.tenant?.brandingTitle || TITLE_DEFAULT; |         let title = this.brand?.brandingTitle || TITLE_DEFAULT; | ||||||
|         if (this.endpointName) { |         if (this.endpointName) { | ||||||
|             title = `${this.endpointName} - ${title}`; |             title = `${this.endpointName} - ${title}`; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ import { configureSentry } from "@goauthentik/common/sentry"; | |||||||
| import { first } from "@goauthentik/common/utils"; | import { first } from "@goauthentik/common/utils"; | ||||||
| import { WebsocketClient } from "@goauthentik/common/ws"; | import { WebsocketClient } from "@goauthentik/common/ws"; | ||||||
| import { Interface } from "@goauthentik/elements/Interface"; | import { Interface } from "@goauthentik/elements/Interface"; | ||||||
|  | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import "@goauthentik/elements/LoadingOverlay"; | import "@goauthentik/elements/LoadingOverlay"; | ||||||
| import "@goauthentik/elements/ak-locale-context"; | import "@goauthentik/elements/ak-locale-context"; | ||||||
| import "@goauthentik/flow/sources/apple/AppleLoginInit"; | import "@goauthentik/flow/sources/apple/AppleLoginInit"; | ||||||
| @ -45,7 +46,7 @@ import { | |||||||
| } from "@goauthentik/api"; | } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| @customElement("ak-flow-executor") | @customElement("ak-flow-executor") | ||||||
| export class FlowExecutor extends Interface implements StageHost { | export class FlowExecutor extends WithBrandConfig(Interface) implements StageHost { | ||||||
|     @property() |     @property() | ||||||
|     flowSlug: string = window.location.pathname.split("/")[3]; |     flowSlug: string = window.location.pathname.split("/")[3]; | ||||||
|  |  | ||||||
| @ -55,9 +56,9 @@ export class FlowExecutor extends Interface implements StageHost { | |||||||
|     set challenge(value: ChallengeTypes | undefined) { |     set challenge(value: ChallengeTypes | undefined) { | ||||||
|         this._challenge = value; |         this._challenge = value; | ||||||
|         if (value?.flowInfo?.title) { |         if (value?.flowInfo?.title) { | ||||||
|             document.title = `${value.flowInfo?.title} - ${this.tenant?.brandingTitle}`; |             document.title = `${value.flowInfo?.title} - ${this.brand?.brandingTitle}`; | ||||||
|         } else { |         } else { | ||||||
|             document.title = this.tenant?.brandingTitle || TITLE_DEFAULT; |             document.title = this.brand?.brandingTitle || TITLE_DEFAULT; | ||||||
|         } |         } | ||||||
|         this.requestUpdate(); |         this.requestUpdate(); | ||||||
|     } |     } | ||||||
| @ -213,10 +214,8 @@ export class FlowExecutor extends Interface implements StageHost { | |||||||
|             if (this.challenge.flowInfo) { |             if (this.challenge.flowInfo) { | ||||||
|                 this.flowInfo = this.challenge.flowInfo; |                 this.flowInfo = this.challenge.flowInfo; | ||||||
|             } |             } | ||||||
|             if (this.challenge.responseErrors) { |  | ||||||
|                 return false; |             return this.challenge.responseErrors ? false : true; | ||||||
|             } |  | ||||||
|             return true; |  | ||||||
|         } catch (exc: unknown) { |         } catch (exc: unknown) { | ||||||
|             this.errorMessage(exc as Error | ResponseError); |             this.errorMessage(exc as Error | ResponseError); | ||||||
|             return false; |             return false; | ||||||
| @ -430,7 +429,7 @@ export class FlowExecutor extends Interface implements StageHost { | |||||||
|  |  | ||||||
|     renderChallengeWrapper(): TemplateResult { |     renderChallengeWrapper(): TemplateResult { | ||||||
|         const logo = html`<div class="pf-c-login__main-header pf-c-brand ak-brand"> |         const logo = html`<div class="pf-c-login__main-header pf-c-brand ak-brand"> | ||||||
|             <img src="${first(this.tenant?.brandingLogo, "")}" alt="authentik Logo" /> |             <img src="${first(this.brand?.brandingLogo, "")}" alt="authentik Logo" /> | ||||||
|         </div>`; |         </div>`; | ||||||
|         if (!this.challenge) { |         if (!this.challenge) { | ||||||
|             return html`${logo}<ak-empty-state ?loading=${true} header=${msg("Loading")}> |             return html`${logo}<ak-empty-state ?loading=${true} header=${msg("Loading")}> | ||||||
| @ -483,12 +482,20 @@ export class FlowExecutor extends Interface implements StageHost { | |||||||
|                             <div class="pf-c-drawer__body"> |                             <div class="pf-c-drawer__body"> | ||||||
|                                 <div class="pf-c-login ${this.getLayout()}"> |                                 <div class="pf-c-login ${this.getLayout()}"> | ||||||
|                                     <div class="${this.getLayoutClass()}"> |                                     <div class="${this.getLayoutClass()}"> | ||||||
|  |                                         <header class="pf-c-login__header"> | ||||||
|  |                                             <div class="pf-c-brand ak-brand"> | ||||||
|  |                                                 <img | ||||||
|  |                                                     src="${first(this.brand?.brandingLogo, "")}" | ||||||
|  |                                                     alt="authentik Logo" | ||||||
|  |                                                 /> | ||||||
|  |                                             </div> | ||||||
|  |                                         </header> | ||||||
|                                         <div class="pf-c-login__main"> |                                         <div class="pf-c-login__main"> | ||||||
|                                             ${this.renderChallengeWrapper()} |                                             ${this.renderChallengeWrapper()} | ||||||
|                                         </div> |                                         </div> | ||||||
|                                         <footer class="pf-c-login__footer"> |                                         <footer class="pf-c-login__footer"> | ||||||
|                                             <ul class="pf-c-list pf-m-inline"> |                                             <ul class="pf-c-list pf-m-inline"> | ||||||
|                                                 ${this.tenant?.uiFooterLinks?.map((link) => { |                                                 ${this.brand?.uiFooterLinks?.map((link) => { | ||||||
|                                                     return html`<li> |                                                     return html`<li> | ||||||
|                                                         <a href="${link.href || ""}" |                                                         <a href="${link.href || ""}" | ||||||
|                                                             >${link.name}</a |                                                             >${link.name}</a | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ import { globalAK } from "@goauthentik/common/global"; | |||||||
| import { first, getCookie } from "@goauthentik/common/utils"; | import { first, getCookie } from "@goauthentik/common/utils"; | ||||||
| import { Interface } from "@goauthentik/elements/Interface"; | import { Interface } from "@goauthentik/elements/Interface"; | ||||||
| import "@goauthentik/elements/ak-locale-context"; | import "@goauthentik/elements/ak-locale-context"; | ||||||
| import { DefaultTenant } from "@goauthentik/elements/sidebar/SidebarBrand"; | import { DefaultBrand } from "@goauthentik/elements/sidebar/SidebarBrand"; | ||||||
| import "rapidoc"; | import "rapidoc"; | ||||||
|  |  | ||||||
| import { CSSResult, TemplateResult, css, html } from "lit"; | import { CSSResult, TemplateResult, css, html } from "lit"; | ||||||
| @ -103,7 +103,7 @@ export class APIBrowser extends Interface { | |||||||
|                         <img |                         <img | ||||||
|                             alt="authentik Logo" |                             alt="authentik Logo" | ||||||
|                             class="logo" |                             class="logo" | ||||||
|                             src="${first(this.tenant?.brandingLogo, DefaultTenant.brandingLogo)}" |                             src="${first(this.brand?.brandingLogo, DefaultBrand.brandingLogo)}" | ||||||
|                         /> |                         /> | ||||||
|                     </div> |                     </div> | ||||||
|                 </rapi-doc> |                 </rapi-doc> | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ import "@goauthentik/elements/notifications/NotificationDrawer"; | |||||||
| import { getURLParam, updateURLParams } from "@goauthentik/elements/router/RouteMatch"; | import { getURLParam, updateURLParams } from "@goauthentik/elements/router/RouteMatch"; | ||||||
| import "@goauthentik/elements/router/RouterOutlet"; | import "@goauthentik/elements/router/RouterOutlet"; | ||||||
| import "@goauthentik/elements/sidebar/Sidebar"; | import "@goauthentik/elements/sidebar/Sidebar"; | ||||||
| import { DefaultTenant } from "@goauthentik/elements/sidebar/SidebarBrand"; | import { DefaultBrand } from "@goauthentik/elements/sidebar/SidebarBrand"; | ||||||
| import "@goauthentik/elements/sidebar/SidebarItem"; | import "@goauthentik/elements/sidebar/SidebarItem"; | ||||||
| import { ROUTES } from "@goauthentik/user/Routes"; | import { ROUTES } from "@goauthentik/user/Routes"; | ||||||
| import "@patternfly/elements/pf-tooltip/pf-tooltip.js"; | import "@patternfly/elements/pf-tooltip/pf-tooltip.js"; | ||||||
| @ -192,11 +192,8 @@ export class UserInterface extends Interface { | |||||||
|                         <a href="#/" class="pf-c-page__header-brand-link"> |                         <a href="#/" class="pf-c-page__header-brand-link"> | ||||||
|                             <img |                             <img | ||||||
|                                 class="pf-c-brand" |                                 class="pf-c-brand" | ||||||
|                                 src="${first( |                                 src="${first(this.brand?.brandingLogo, DefaultBrand.brandingLogo)}" | ||||||
|                                     this.tenant?.brandingLogo, |                                 alt="${(this.brand?.brandingTitle, DefaultBrand.brandingTitle)}" | ||||||
|                                     DefaultTenant.brandingLogo, |  | ||||||
|                                 )}" |  | ||||||
|                                 alt="${(this.tenant?.brandingTitle, DefaultTenant.brandingTitle)}" |  | ||||||
|                             /> |                             /> | ||||||
|                         </a> |                         </a> | ||||||
|                     </div> |                     </div> | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ import { EVENT_REFRESH } from "@goauthentik/common/constants"; | |||||||
| import { MessageLevel } from "@goauthentik/common/messages"; | import { MessageLevel } from "@goauthentik/common/messages"; | ||||||
| import { refreshMe } from "@goauthentik/common/users"; | import { refreshMe } from "@goauthentik/common/users"; | ||||||
| import { AKElement } from "@goauthentik/elements/Base"; | import { AKElement } from "@goauthentik/elements/Base"; | ||||||
| import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider"; | import { WithBrandConfig } from "@goauthentik/elements/Interface/brandProvider"; | ||||||
| import { showMessage } from "@goauthentik/elements/messages/MessageContainer"; | import { showMessage } from "@goauthentik/elements/messages/MessageContainer"; | ||||||
| import { StageHost } from "@goauthentik/flow/stages/base"; | import { StageHost } from "@goauthentik/flow/stages/base"; | ||||||
| import "@goauthentik/user/user-settings/details/stages/prompt/PromptStage"; | import "@goauthentik/user/user-settings/details/stages/prompt/PromptStage"; | ||||||
| @ -31,10 +31,7 @@ import { | |||||||
| } from "@goauthentik/api"; | } from "@goauthentik/api"; | ||||||
|  |  | ||||||
| @customElement("ak-user-settings-flow-executor") | @customElement("ak-user-settings-flow-executor") | ||||||
| export class UserSettingsFlowExecutor | export class UserSettingsFlowExecutor extends WithBrandConfig(AKElement) implements StageHost { | ||||||
|     extends WithTenantConfig(AKElement, true) |  | ||||||
|     implements StageHost |  | ||||||
| { |  | ||||||
|     @property() |     @property() | ||||||
|     flowSlug?: string; |     flowSlug?: string; | ||||||
|  |  | ||||||
| @ -87,7 +84,7 @@ export class UserSettingsFlowExecutor | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     firstUpdated(): void { |     firstUpdated(): void { | ||||||
|         this.flowSlug = this.tenant?.flowUserSettings; |         this.flowSlug = this.brand?.flowUserSettings; | ||||||
|         if (!this.flowSlug) { |         if (!this.flowSlug) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	