Skip to content

Commit

Permalink
fix(facebook): Stop tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Jul 3, 2023
1 parent aed4d54 commit 934955f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Backwards incompatible changes
- The Telegram provider settings structure, it now requires to app. Please
refer to the Telegram provider documentation for details.

- The Facebook provider loaded the Facebook connect ``sdk.js`` regardless of the
value of the ``METHOD`` setting. To prevent tracking, now it only loads the
Javascript if ``METHOD`` is explicitly set to ``"js_sdk"``.



0.54.0 (2023-03-31)
Expand Down
3 changes: 3 additions & 0 deletions allauth/socialaccount/providers/facebook/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def get_sdk_url(self, request):
return sdk_url

def media_js(self, request):
if self.get_method() != "js_sdk":
return ""

def abs_uri(name):
return request.build_absolute_uri(reverse(name))

Expand Down
11 changes: 2 additions & 9 deletions docs/providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -623,22 +623,15 @@ To initiate a login use:
{% load socialaccount %}
{% providers_media_js %}
<a href="{% provider_login_url "facebook" method="js_sdk" %}">Facebook Connect</a>
or:

.. code-block:: python
{% load socialaccount %}
<a href="{% provider_login_url "facebook" method="oauth2" %}">Facebook OAuth2</a>
<a href="{% provider_login_url "facebook" %}">Facebook Connect</a>
The following Facebook settings are available:

.. code-block:: python
SOCIALACCOUNT_PROVIDERS = {
'facebook': {
'METHOD': 'oauth2',
'METHOD': 'oauth2', # Set to 'js_sdk' to use the Facebook connect SDK
'SDK_URL': '//connect.facebook.net/{locale}/sdk.js',
'SCOPE': ['email', 'public_profile'],
'AUTH_PARAMS': {'auth_type': 'reauthenticate'},
Expand Down

0 comments on commit 934955f

Please sign in to comment.