From 16d989dbfa7d97f6ea45a1a04b34bac4ed331601 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 4 Apr 2021 16:15:50 +0200 Subject: [PATCH] core: fix schema for Challenge's type enum Signed-off-by: Jens Langhammer --- authentik/core/types.py | 2 +- authentik/flows/challenge.py | 2 +- swagger.yaml | 6 +++--- web/src/flows/FlowExecutor.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/authentik/core/types.py b/authentik/core/types.py index 523ce0ae8..988a9aea6 100644 --- a/authentik/core/types.py +++ b/authentik/core/types.py @@ -26,7 +26,7 @@ class UILoginButtonSerializer(PassiveSerializer): name = CharField() url = CharField() - icon_url = CharField(required=False) + icon_url = CharField(required=False, allow_null=True) class UserSettingSerializer(PassiveSerializer): diff --git a/authentik/flows/challenge.py b/authentik/flows/challenge.py index e209b1d55..f1f04a9ab 100644 --- a/authentik/flows/challenge.py +++ b/authentik/flows/challenge.py @@ -33,7 +33,7 @@ class Challenge(PassiveSerializer): is currently active""" type = ChoiceField( - choices=[(x.name, x.name) for x in ChallengeTypes], + choices=[(x.value, x.name) for x in ChallengeTypes], ) component = CharField(required=False) title = CharField(required=False) diff --git a/swagger.yaml b/swagger.yaml index f5ef4f0cf..bf0ad9a2a 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -15238,9 +15238,9 @@ definitions: title: Type type: string enum: - - NATIVE - - SHELL - - REDIRECT + - native + - shell + - redirect component: title: Component type: string diff --git a/web/src/flows/FlowExecutor.ts b/web/src/flows/FlowExecutor.ts index 333375ac3..b422b6d1c 100644 --- a/web/src/flows/FlowExecutor.ts +++ b/web/src/flows/FlowExecutor.ts @@ -172,7 +172,7 @@ export class FlowExecutor extends LitElement implements StageHost { if (!this.challenge) { return html``; } - switch (this.challenge.type.toUpperCase()) { + switch (this.challenge.type) { case ChallengeTypeEnum.Redirect: console.debug("authentik/flows: redirecting to url from server", (this.challenge as RedirectChallenge).to); window.location.assign((this.challenge as RedirectChallenge).to);