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()
url = CharField()
icon_url = CharField(required=False)
icon_url = CharField(required=False, allow_null=True)
class UserSettingSerializer(PassiveSerializer):

View file

@ -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)

View file

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

View file

@ -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);