From ade2d4879c98b67e3c44b915b92cfcb4cf342330 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 28 Jul 2022 21:19:21 +0200 Subject: [PATCH] stages/authenticator_duo: fix imported Duo Device not having a name Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_duo/api.py | 5 ++++- authentik/stages/authenticator_duo/stage.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/authentik/stages/authenticator_duo/api.py b/authentik/stages/authenticator_duo/api.py index 66fbba77e..3c403659f 100644 --- a/authentik/stages/authenticator_duo/api.py +++ b/authentik/stages/authenticator_duo/api.py @@ -111,7 +111,10 @@ class AuthenticatorDuoStageViewSet(UsedByMixin, ModelViewSet): if device: return Response(data={"non_field_errors": ["device exists already"]}, status=400) DuoDevice.objects.create( - duo_user_id=request.query_params.get("duo_user_id"), user=user, stage=stage + duo_user_id=request.query_params.get("duo_user_id"), + user=user, + stage=stage, + name="Imported Duo Authenticator", ) return Response(status=204) diff --git a/authentik/stages/authenticator_duo/stage.py b/authentik/stages/authenticator_duo/stage.py index 433e811ab..5ea827104 100644 --- a/authentik/stages/authenticator_duo/stage.py +++ b/authentik/stages/authenticator_duo/stage.py @@ -83,7 +83,7 @@ class AuthenticatorDuoStageView(ChallengeStageView): self.request.session.pop(SESSION_KEY_DUO_ACTIVATION_CODE) if not existing_device: DuoDevice.objects.create( - name="Duo Device", + name="Duo Authenticator", user=self.get_pending_user(), duo_user_id=user_id, stage=stage,