web/admin: pass full configure flow URL instead of just boolean

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-06-08 17:14:54 +02:00
parent ba1b23c879
commit 75404f1345
8 changed files with 22 additions and 33 deletions

View File

@ -3,15 +3,14 @@ import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { until } from "lit-html/directives/until";
import { DEFAULT_CONFIG } from "../../../api/Config";
import { FlowURLManager } from "../../../api/legacy";
import { STATIC_TOKEN_STYLE } from "../../../flows/stages/authenticator_static/AuthenticatorStaticStage";
import { BaseUserSettings } from "./BaseUserSettings";
@customElement("ak-user-settings-authenticator-static")
export class UserSettingsAuthenticatorStatic extends BaseUserSettings {
@property({ type: Boolean })
configureFlow = false;
@property()
configureFlow?: string;
static get styles(): CSSResult[] {
return super.styles.concat(STATIC_TOKEN_STYLE);
@ -65,7 +64,7 @@ export class UserSettingsAuthenticatorStatic extends BaseUserSettings {
</div>
<div class="pf-c-card__footer">
${this.configureFlow ?
html`<a href="${FlowURLManager.configure(this.objectId || "", "?next=/%23%2Fuser")}"
html`<a href="${this.configureFlow}?next=/%23%2Fuser"
class="pf-c-button pf-m-primary">${t`Enable Static Tokens`}
</a>`: html``}
</div>`;