From 64ab8be2f0c0b89f6c38f00e10c2136c6f4ef79f Mon Sep 17 00:00:00 2001 From: Philippe Luickx Date: Thu, 13 Aug 2015 10:56:25 +0300 Subject: [PATCH] catching incorrect input --- rest_auth/registration/serializers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 2500e32..3403c7c 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -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