flows: move flow relevant info into ContextualFlowInfo

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-06-08 16:53:28 +02:00
parent ae8cf00a21
commit ba1b23c879
21 changed files with 111 additions and 113 deletions

View File

@ -86,8 +86,8 @@ export class FlowExecutor extends LitElement implements StageHost {
private postUpdate(): void {
tenant().then(tenant => {
if (this.challenge?.title) {
document.title = `${this.challenge.title} - ${tenant.brandingTitle}`;
if (this.challenge?.flowInfo.title) {
document.title = `${this.challenge.flowInfo.title} - ${tenant.brandingTitle}`;
} else {
document.title = tenant.brandingTitle || TITLE_DEFAULT;
}
@ -124,8 +124,8 @@ export class FlowExecutor extends LitElement implements StageHost {
}).then((challenge) => {
this.challenge = challenge;
// Only set background on first update, flow won't change throughout execution
if (this.challenge?.background) {
this.setBackground(this.challenge.background);
if (this.challenge?.flowInfo.background) {
this.setBackground(this.challenge.flowInfo.background);
}
this.postUpdate();
}).catch((e: Error) => {
@ -271,7 +271,7 @@ export class FlowExecutor extends LitElement implements StageHost {
${this.tenant?.brandingTitle != "authentik" ? html`
<li><a href="https://goauthentik.io">${t`Powered by authentik`}</a></li>
` : html``}
${this.challenge?.background?.startsWith("/static") ? html`
${this.challenge?.flowInfo.background?.startsWith("/static") ? html`
<li><a href="https://unsplash.com/@danasaki">${t`Background image`}</a></li>
` : html``}
</ul>