diff --git a/docs/source/application.rst b/docs/source/application.rst index 4732fd7..396c0fc 100644 --- a/docs/source/application.rst +++ b/docs/source/application.rst @@ -27,3 +27,5 @@ Screenshot of the new application creation. :class: png :width: 1200 :alt: Adding a new application to your drf-social-oauth2 installation. + +Please, read the :ref:`integration` in order to integrate social libraries into your project. diff --git a/docs/source/conf.py b/docs/source/conf.py index be02ba5..1234e45 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,7 @@ project = 'drf-social-oauth2' copyright = '2023, Wagner de Lima' author = 'Wagner de Lima' -release = '2.1.0' +release = '2.1.1' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/source/installation.rst b/docs/source/installation.rst index f63abbf..353632e 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -23,7 +23,7 @@ This framework is published at the PyPI, install it with pip: .. code-block:: console - $ pip install drf_social_oauth2==2.1.0 + $ pip install drf_social_oauth2==2.1.1 To enable OAuth2 social authentication support for your Django REST Framework application, you need to install diff --git a/docs/source/integration.rst b/docs/source/integration.rst index cfeffd9..0911e47 100644 --- a/docs/source/integration.rst +++ b/docs/source/integration.rst @@ -1,3 +1,5 @@ +.. _integration: + Integration Social Backends =========================== @@ -247,3 +249,9 @@ The Client ID should be added on SOCIAL_AUTH_GITHUB_KEY and the `SOCIAL_AUTH_GIT Now, visit https://github.com/settings/tokens and create a new token. Select the user checkbox, as to grant user access. The click on the Generate Token button. Use the access token as the token parameter in the /convert-token endpoint. + +Other Backend Integration +========================= + +DRF-Social-Oauth2 is not only limited to Google, Facebook and Github. You can integrate with every backend described +at the Python Social Oauth backend integrations. diff --git a/drf_social_oauth2/__init__.py b/drf_social_oauth2/__init__.py index 78f21dd..ce7c3df 100644 --- a/drf_social_oauth2/__init__.py +++ b/drf_social_oauth2/__init__.py @@ -6,7 +6,7 @@ and a ton more! """ -__version__ = '2.1.0' +__version__ = '2.1.1' try: from secrets import SystemRandom diff --git a/drf_social_oauth2/views.py b/drf_social_oauth2/views.py index 218936a..7b8ead3 100644 --- a/drf_social_oauth2/views.py +++ b/drf_social_oauth2/views.py @@ -80,10 +80,7 @@ def post(self, request: Request, *args, **kwargs): status=HTTP_400_BAD_REQUEST, ) - response = Response(data=json_loads(body), status=status) - for k, v in headers.items(): - response[k] = v - return response + return Response(data=json_loads(body), status=status) class ConvertTokenView(CsrfExemptMixin, OAuthLibMixin, APIView): @@ -137,11 +134,7 @@ def post(self, request: Request, *args, **kwargs): status=HTTP_400_BAD_REQUEST, ) - response = Response(data=json_loads(body), status=status) - - for k, v in headers.items(): - response[k] = v - return response + return Response(data=json_loads(body), status=status) class RevokeTokenView(CsrfExemptMixin, OAuthLibMixin, APIView): @@ -163,14 +156,10 @@ def post(self, request: Request, *args, **kwargs): request._request.POST[key] = value url, headers, body, status = self.create_revocation_response(request._request) - response = Response( + return Response( data=json_loads(body) if body else '', status=status if body else 204 ) - for k, v in headers.items(): - response[k] = v - return response - class InvalidateSessions(APIView): """