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()
|
||||
url = CharField()
|
||||
icon_url = CharField(required=False)
|
||||
icon_url = CharField(required=False, allow_null=True)
|
||||
|
||||
|
||||
class UserSettingSerializer(PassiveSerializer):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -15238,9 +15238,9 @@ definitions:
|
|||
title: Type
|
||||
type: string
|
||||
enum:
|
||||
- NATIVE
|
||||
- SHELL
|
||||
- REDIRECT
|
||||
- native
|
||||
- shell
|
||||
- redirect
|
||||
component:
|
||||
title: Component
|
||||
type: string
|
||||
|
|
|
@ -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);
|
||||
|
|
Reference in a new issue