mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-26 02:53:46 +03:00
catching incorrect input
This commit is contained in:
parent
5a6c8f549b
commit
64ab8be2f0
|
@ -85,6 +85,9 @@ class SocialLoginSerializer(serializers.Serializer):
|
|||
)
|
||||
token = client.get_access_token(code)
|
||||
access_token = token['access_token']
|
||||
|
||||
else:
|
||||
raise serializers.ValidationError('Incorrect input. access_token or code is required.')
|
||||
|
||||
token = adapter.parse_token({'access_token': access_token})
|
||||
token.app = app
|
||||
|
|
Loading…
Reference in New Issue
Block a user