Update U2F.py

fix get instead of filter in function call
This commit is contained in:
BIZ Factory GmbH
2021-03-01 08:25:48 +01:00
committed by GitHub
parent a48ae253d6
commit 4fbe88b90f

View File

@@ -52,7 +52,7 @@ def validate(request,username):
challenge = request.session.pop('_u2f_challenge_')
device, c, t = complete_authentication(challenge, data, [settings.U2F_APPID])
key = User_Keys.objects.filter(username=username, properties__iregex=rf'{device["publicKey"]}')
key = User_Keys.objects.get(username=username, properties__iregex=rf'{device["publicKey"]}')
key.last_used=timezone.now()
key.save()
mfa = {"verified": True, "method": "U2F","id":key.id}