mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-07 05:30:33 +03:00
Password whitespace and input in browsable API
- Do not trim password whitespace (`trim_whitespace`, see: http://www.django-rest-framework.org/api-guide/fields/#charfield) - Mask password input (inspired by https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/serializers.py#L11-L12)
This commit is contained in:
parent
e4c04528a2
commit
28e712cf4b
|
@ -125,8 +125,8 @@ class RegisterSerializer(serializers.Serializer):
|
|||
required=allauth_settings.USERNAME_REQUIRED
|
||||
)
|
||||
email = serializers.EmailField(required=allauth_settings.EMAIL_REQUIRED)
|
||||
password1 = serializers.CharField(write_only=True)
|
||||
password2 = serializers.CharField(write_only=True)
|
||||
password1 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False)
|
||||
password2 = serializers.CharField(write_only=True, style={'input_type': 'password'}, trim_whitespace=False)
|
||||
|
||||
def validate_username(self, username):
|
||||
username = get_adapter().clean_username(username)
|
||||
|
|
Loading…
Reference in New Issue
Block a user