stages/authenticator_duo: fix devices created with name

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-11 22:16:47 +01:00
parent 00324f922d
commit 6db1c914ee
1 changed files with 3 additions and 1 deletions

View File

@ -84,7 +84,9 @@ class AuthenticatorDuoStageView(ChallengeStageView):
self.request.session.pop(SESSION_KEY_DUO_USER_ID) self.request.session.pop(SESSION_KEY_DUO_USER_ID)
self.request.session.pop(SESSION_KEY_DUO_ACTIVATION_CODE) self.request.session.pop(SESSION_KEY_DUO_ACTIVATION_CODE)
if not existing_device: if not existing_device:
DuoDevice.objects.create(user=self.get_pending_user(), duo_user_id=user_id, stage=stage) DuoDevice.objects.create(
name="Duo Device", user=self.get_pending_user(), duo_user_id=user_id, stage=stage
)
else: else:
return self.executor.stage_invalid("Device with Credential ID already exists.") return self.executor.stage_invalid("Device with Credential ID already exists.")
return self.executor.stage_ok() return self.executor.stage_ok()