From e176e11b827a08a2ad3c9f78b439d0bcb74aa5e0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 5 Oct 2023 19:06:08 +0200 Subject: [PATCH] generate device with random name as we need to create them in the database Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_mobile/stage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/authentik/stages/authenticator_mobile/stage.py b/authentik/stages/authenticator_mobile/stage.py index 22cb21b94..b5d7039e0 100644 --- a/authentik/stages/authenticator_mobile/stage.py +++ b/authentik/stages/authenticator_mobile/stage.py @@ -10,6 +10,7 @@ from authentik.flows.challenge import ( WithUserInfoChallenge, ) from authentik.flows.stage import ChallengeStageView +from authentik.lib.generators import generate_id from authentik.stages.authenticator_mobile.models import MobileDevice, MobileDeviceToken FLOW_PLAN_MOBILE_ENROLL_TOKEN = "authentik/stages/authenticator_mobile/enroll/token" # nosec @@ -47,6 +48,7 @@ class AuthenticatorMobileStageView(ChallengeStageView): if FLOW_PLAN_MOBILE_ENROLL_TOKEN in self.executor.plan.context: return device = MobileDevice.objects.create( + name=generate_id(), user=self.get_pending_user(), stage=self.executor.current_stage, confirmed=False,