mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-06-03 04:23:04 +03:00
catching incorrect input
This commit is contained in:
parent
5a6c8f549b
commit
64ab8be2f0
|
@ -86,6 +86,9 @@ class SocialLoginSerializer(serializers.Serializer):
|
||||||
token = client.get_access_token(code)
|
token = client.get_access_token(code)
|
||||||
access_token = token['access_token']
|
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 = adapter.parse_token({'access_token': access_token})
|
||||||
token.app = app
|
token.app = app
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user