Setting Ownership of keys

This commit is contained in:
Mohamed ElKalioby
2019-10-16 14:41:19 +03:00
parent ed204c1d85
commit 9086f47456
6 changed files with 30 additions and 4 deletions

View File

@@ -89,6 +89,7 @@ def bind(request):
User_Keys.objects.filter(username=request.user.username,key_type="U2F").delete()
uk = User_Keys()
uk.username = request.user.username
uk.owned_by_enterprise = getattr(settings, "MFA_OWNED_BY_ENTERPRISE", False)
uk.properties = {"device":simplejson.loads(device.json),"cert":cert_hash}
uk.key_type = "U2F"
uk.save()