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