From 37375461df148eda5cda9ce558c3ad3b2087894b Mon Sep 17 00:00:00 2001 From: Maxim Kukhtenkov Date: Mon, 24 Oct 2016 14:23:44 -0700 Subject: [PATCH] Add info to docs and comments + Add comments by @chubz regarding django-allauth hmac pattern from PR #233 + Cleanup --- docs/api_endpoints.rst | 2 ++ docs/changelog.rst | 1 + docs/faq.rst | 4 ++-- rest_auth/registration/serializers.py | 2 +- rest_auth/registration/urls.py | 2 +- rest_auth/social_serializers.py | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/api_endpoints.rst b/docs/api_endpoints.rst index af7b734..67f8eff 100644 --- a/docs/api_endpoints.rst +++ b/docs/api_endpoints.rst @@ -77,6 +77,8 @@ Basing on example from installation section :doc:`Installation ` - access_token - code + .. note:: ``access_token`` OR ``code`` can be used as standalone arguments, see https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/registration/views.py + - /rest-auth/twitter/ (POST) - access_token diff --git a/docs/changelog.rst b/docs/changelog.rst index 09201f4..f34d1c7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog 0.8.0 ----- - added support for django-rest-framework-jwt +- added support for django-allauth hmac email confirmation pattern - bugfixes 0.7.0 diff --git a/docs/faq.rst b/docs/faq.rst index ff04c13..d15566a 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -7,14 +7,14 @@ FAQ .. code-block:: python - url(r'^account-confirm-email/(?P\w+)/$', TemplateView.as_view(), + url(r'^account-confirm-email/(?P[-:\w]+)/$', TemplateView.as_view(), name='account_confirm_email'), This url is used by django-allauth. Empty TemplateView is defined just to allow reverse() call inside app - when email with verification link is being sent. You should override this view/url to handle it in your API client somehow and then, send post to /verify-email/ endpoint with proper key. If you don't want to use API on that step, then just use ConfirmEmailView view from: - djang-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190 + django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py 2. I get an error: Reverse for 'password_reset_confirm' not found. diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 9056164..e3a5e33 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -36,7 +36,7 @@ class SocialLoginSerializer(serializers.Serializer): :param app: `allauth.socialaccount.SocialApp` instance :param token: `allauth.socialaccount.SocialToken` instance :param response: Provider's response for OAuth1. Not used in the - :return: :return: A populated instance of the `allauth.socialaccount.SocialLoginView` instance + :returns: A populated instance of the `allauth.socialaccount.SocialLoginView` instance """ request = self._get_request() social_login = adapter.complete_login(request, app, token, response=response) diff --git a/rest_auth/registration/urls.py b/rest_auth/registration/urls.py index 8f4d0a2..1004695 100644 --- a/rest_auth/registration/urls.py +++ b/rest_auth/registration/urls.py @@ -17,7 +17,7 @@ urlpatterns = [ # with proper key. # If you don't want to use API on that step, then just use ConfirmEmailView # view from: - # django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190 + # django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py url(r'^account-confirm-email/(?P[-:\w]+)/$', TemplateView.as_view(), name='account_confirm_email'), ] diff --git a/rest_auth/social_serializers.py b/rest_auth/social_serializers.py index 6e06be5..479019e 100644 --- a/rest_auth/social_serializers.py +++ b/rest_auth/social_serializers.py @@ -26,7 +26,7 @@ class TwitterLoginSerializer(serializers.Serializer): :param app: `allauth.socialaccount.SocialApp` instance :param token: `allauth.socialaccount.SocialToken` instance :param response: Provider's response for OAuth1. Not used in the - :return: :return: A populated instance of the `allauth.socialaccount.SocialLoginView` instance + :returns: A populated instance of the `allauth.socialaccount.SocialLoginView` instance """ request = self._get_request() social_login = adapter.complete_login(request, app, token, response=response)