From dfe3f12356db3028f18c06c3fed97e5feac275b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=C5=A1ek=20Dohnal?= Date: Wed, 25 Oct 2017 15:21:53 +0200 Subject: [PATCH] Use same password fields for PasswordChangeSerializer and PasswordResetConfirmSerializer. Thanks @sloria --- rest_auth/serializers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py index 46cbb48..142c6b2 100644 --- a/rest_auth/serializers.py +++ b/rest_auth/serializers.py @@ -187,8 +187,8 @@ class PasswordResetConfirmSerializer(serializers.Serializer): """ Serializer for requesting a password reset e-mail. """ - new_password1 = serializers.CharField(max_length=128) - new_password2 = serializers.CharField(max_length=128) + new_password1 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False) + new_password2 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False) uid = serializers.CharField() token = serializers.CharField() @@ -224,9 +224,9 @@ class PasswordResetConfirmSerializer(serializers.Serializer): class PasswordChangeSerializer(serializers.Serializer): - old_password = serializers.CharField(max_length=128) - new_password1 = serializers.CharField(max_length=128) - new_password2 = serializers.CharField(max_length=128) + old_password = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False) + new_password1 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False) + new_password2 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False) set_password_form_class = SetPasswordForm