mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-05-29 02:03:19 +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)
|
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