Rename pubkey to loginPubkey because we'll soon have another pubkey.

This breaks sharing because we no longer have a normal pubkey.
This will be fixed in the next commit.
This commit is contained in:
Tom Hacohen
2020-05-26 13:23:45 +03:00
parent 2412c295de
commit 863c405802
4 changed files with 22 additions and 6 deletions

View File

@@ -348,13 +348,11 @@ class UserInfoPubkeySerializer(serializers.ModelSerializer):
class AuthenticationSignupSerializer(serializers.Serializer):
user = UserQuerySerializer(many=False)
salt = BinaryBase64Field()
pubkey = BinaryBase64Field()
loginPubkey = BinaryBase64Field()
def create(self, validated_data):
"""Function that's called when this serializer creates an item"""
user_data = validated_data.pop('user')
salt = validated_data.pop('salt')
pubkey = validated_data.pop('pubkey')
with transaction.atomic():
instance, _ = User.objects.get_or_create(**user_data)
@@ -364,7 +362,7 @@ class AuthenticationSignupSerializer(serializers.Serializer):
instance.set_unusable_password()
# FIXME: send email verification
models.UserInfo.objects.create(salt=salt, pubkey=pubkey, owner=instance)
models.UserInfo.objects.create(**validated_data, owner=instance)
return instance