From 8d6db0fabfff85c03af315e637d6ff53f5c0e3b0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 10 Jun 2021 22:07:26 +0200 Subject: [PATCH] flows: fix configuration URL being set when no flow is configure Signed-off-by: Jens Langhammer --- authentik/core/types.py | 2 +- authentik/flows/api/stages.py | 2 +- schema.yml | 3 +-- web/src/pages/user-settings/UserSettingsPage.ts | 12 ++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/authentik/core/types.py b/authentik/core/types.py index 4773e826a..3226db60a 100644 --- a/authentik/core/types.py +++ b/authentik/core/types.py @@ -36,4 +36,4 @@ class UserSettingSerializer(PassiveSerializer): object_uid = CharField() component = CharField() title = CharField() - configure_url = CharField() + configure_url = CharField(required=False) diff --git a/authentik/flows/api/stages.py b/authentik/flows/api/stages.py index 87500f299..e9706caac 100644 --- a/authentik/flows/api/stages.py +++ b/authentik/flows/api/stages.py @@ -93,7 +93,7 @@ class StageViewSet( if not user_settings: continue user_settings.initial_data["object_uid"] = str(stage.pk) - if hasattr(stage, "configure_flow"): + if hasattr(stage, "configure_flow") and stage.configure_flow: user_settings.initial_data["configure_url"] = reverse( "authentik_flows:configure", kwargs={"stage_uuid": stage.pk}, diff --git a/schema.yml b/schema.yml index 391797269..a963ba658 100644 --- a/schema.yml +++ b/schema.yml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: authentik - version: 2021.6.1-rc1 + version: 2021.6.1-rc4 description: Making authentication simple. contact: email: hello@beryju.org @@ -27917,7 +27917,6 @@ components: type: string required: - component - - configure_url - object_uid - title UserWriteStage: diff --git a/web/src/pages/user-settings/UserSettingsPage.ts b/web/src/pages/user-settings/UserSettingsPage.ts index e8b4f15d1..e2427e510 100644 --- a/web/src/pages/user-settings/UserSettingsPage.ts +++ b/web/src/pages/user-settings/UserSettingsPage.ts @@ -38,19 +38,19 @@ export class UserSettingsPage extends LitElement { renderStageSettings(stage: UserSetting): TemplateResult { switch (stage.component) { case "ak-user-settings-authenticator-webauthn": - return html` + return html` `; case "ak-user-settings-password": - return html` + return html` `; case "ak-user-settings-authenticator-totp": - return html` + return html` `; case "ak-user-settings-authenticator-static": - return html` + return html` `; case "ak-user-settings-authenticator-duo": - return html` + return html` `; default: return html`

${t`Error: unsupported stage settings: ${stage.component}`}

`; @@ -60,7 +60,7 @@ export class UserSettingsPage extends LitElement { renderSourceSettings(source: UserSetting): TemplateResult { switch (source.component) { case "ak-user-settings-source-oauth": - return html` + return html` `; default: return html`

${t`Error: unsupported source settings: ${source.component}`}

`;