diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 4f99c18..a819776 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -83,8 +83,8 @@ class SocialLoginSerializer(serializers.Serializer): # Case 2: We received the authorization code elif attrs.get('code'): - self.callback_url = getattr(view, 'callback_url', None) - self.client_class = getattr(view, 'client_class', None) + self.callback_url = view.get_callback_url() + self.client_class = view.get_client_class() if not self.callback_url: raise serializers.ValidationError( diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 0e0ab0d..599c230 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -123,6 +123,12 @@ class SocialLoginView(LoginView): """ serializer_class = SocialLoginSerializer + def get_callback_url(self): + return getattr(self, 'callback_url', None) + + def get_client_class(self): + return getattr(self, 'client_class', None) + def process_login(self): get_adapter(self.request).login(self.request, self.user)