diff --git a/web/src/elements/Interface/brandProvider.ts b/web/src/elements/Interface/brandProvider.ts index 912466d963..170225e462 100644 --- a/web/src/elements/Interface/brandProvider.ts +++ b/web/src/elements/Interface/brandProvider.ts @@ -3,6 +3,7 @@ import type { AbstractConstructor } from "@goauthentik/elements/types.js"; import { consume } from "@lit/context"; import type { LitElement } from "lit"; +import { state } from "lit/decorators.js"; import type { CurrentBrand } from "@goauthentik/api"; @@ -12,6 +13,7 @@ export function WithBrandConfig>( ) { abstract class WithBrandProvider extends superclass { @consume({ context: authentikBrandContext, subscribe }) + @state() public brand!: CurrentBrand; } return WithBrandProvider; diff --git a/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts b/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts index 4ad334e59e..1384469cf7 100644 --- a/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts +++ b/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts @@ -10,7 +10,7 @@ import { StageHost } from "@goauthentik/flow/stages/base"; import "@goauthentik/user/user-settings/details/stages/prompt/PromptStage"; import { msg } from "@lit/localize"; -import { CSSResult, TemplateResult, html } from "lit"; +import { CSSResult, PropertyValues, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; @@ -83,12 +83,14 @@ export class UserSettingsFlowExecutor }); } - firstUpdated(): void { - this.flowSlug = this.brand?.flowUserSettings; - if (!this.flowSlug) { - return; + updated(changedProperties: PropertyValues): void { + if (changedProperties.has("brand") && this.brand) { + this.flowSlug = this.brand?.flowUserSettings; + if (!this.flowSlug) { + return; + } + this.nextChallenge(); } - this.nextChallenge(); } async nextChallenge(): Promise { @@ -161,7 +163,7 @@ export class UserSettingsFlowExecutor // Flow has finished, so let's load while in the background we can restart the flow this.loading = true; console.debug("authentik/user/flows: redirect to '/', restarting flow."); - this.firstUpdated(); + this.nextChallenge(); this.globalRefresh(); showMessage({ level: MessageLevel.success,