core: fix schema for Challenge's type enum
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
9517c890b5
commit
16d989dbfa
|
@ -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):
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Reference in New Issue