Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-07-24 23:59:35 +02:00
parent ccb2d0aaed
commit a895157be1
No known key found for this signature in database
4 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class AuthenticatorMobileStageViewSet(UsedByMixin, ModelViewSet):
)
@action(methods=["POST"], detail=True, permission_classes=[])
def enrollment_callback(self, request: Request, pk: str) -> Response:
pass
"""Enrollment callback"""
class MobileDeviceSerializer(ModelSerializer):

View File

@ -80,6 +80,8 @@ class MobileDevice(SerializerModel, Device):
class MobileDeviceToken(ExpiringModel):
"""Mobile device token"""
device = models.ForeignKey(MobileDevice, on_delete=models.CASCADE, null=True)
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
token = models.TextField(default=default_token_key)

View File

@ -42,6 +42,7 @@ class AuthenticatorMobileStageView(ChallengeStageView):
response_class = AuthenticatorMobileChallengeResponse
def prepare(self):
"""Prepare the token"""
if FLOW_PLAN_MOBILE_ENROLL in self.executor.plan.context:
return
token = MobileDeviceToken.objects.create(

View File

@ -23424,7 +23424,7 @@ paths:
/stages/authenticator/mobile/{stage_uuid}/enrollment_callback/:
post:
operationId: stages_authenticator_mobile_enrollment_callback_create
description: AuthenticatorMobileStage Viewset
description: Enrollment callback
parameters:
- in: path
name: stage_uuid