make extended login challenges not hardcoded

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2024-07-22 00:06:06 +02:00
parent 30a9e597e9
commit 9f74d2cb09
2 changed files with 7 additions and 3 deletions

View File

@ -60,18 +60,22 @@ class Challenge(PassiveSerializer):
)
class LoginChallenge(Challenge):
"""Base class for extended login challenges"""
class RedirectChallenge(Challenge):
"""Challenge type to redirect the client"""
to = CharField()
component = CharField(default="xak-flow-redirect")
to = CharField()
class ShellChallenge(Challenge):
"""challenge type to render HTML as-is"""
body = CharField()
component = CharField(default="xak-flow-shell")
body = CharField()
class WithUserInfoChallenge(Challenge):

View File

@ -107,7 +107,7 @@ class AppleType(SourceType):
authorization_code_auth_method = AuthorizationCodeAuthMethod.POST_BODY
def login_challenge(self, source: OAuthSource, request: HttpRequest) -> Challenge:
def login_challenge(self, source: OAuthSource, request: HttpRequest) -> AppleLoginChallenge:
"""Pre-general all the things required for the JS SDK"""
apple_client = AppleOAuthClient(
source,