core: fix schema for Challenge's type enum

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-04 16:15:50 +02:00
parent 9517c890b5
commit 16d989dbfa
4 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class UILoginButtonSerializer(PassiveSerializer):
name = CharField() name = CharField()
url = CharField() url = CharField()
icon_url = CharField(required=False) icon_url = CharField(required=False, allow_null=True)
class UserSettingSerializer(PassiveSerializer): class UserSettingSerializer(PassiveSerializer):

View File

@ -33,7 +33,7 @@ class Challenge(PassiveSerializer):
is currently active""" is currently active"""
type = ChoiceField( type = ChoiceField(
choices=[(x.name, x.name) for x in ChallengeTypes], choices=[(x.value, x.name) for x in ChallengeTypes],
) )
component = CharField(required=False) component = CharField(required=False)
title = CharField(required=False) title = CharField(required=False)

View File

@ -15238,9 +15238,9 @@ definitions:
title: Type title: Type
type: string type: string
enum: enum:
- NATIVE - native
- SHELL - shell
- REDIRECT - redirect
component: component:
title: Component title: Component
type: string type: string

View File

@ -172,7 +172,7 @@ export class FlowExecutor extends LitElement implements StageHost {
if (!this.challenge) { if (!this.challenge) {
return html``; return html``;
} }
switch (this.challenge.type.toUpperCase()) { switch (this.challenge.type) {
case ChallengeTypeEnum.Redirect: case ChallengeTypeEnum.Redirect:
console.debug("authentik/flows: redirecting to url from server", (this.challenge as RedirectChallenge).to); console.debug("authentik/flows: redirecting to url from server", (this.challenge as RedirectChallenge).to);
window.location.assign((this.challenge as RedirectChallenge).to); window.location.assign((this.challenge as RedirectChallenge).to);