Skip to content

Commit

Permalink
fix(socialaccount): Don't return access token in __str__
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Jul 10, 2024
1 parent aa33e2f commit 663c7df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
0.63.4 (unreleased)
*******************

- ...
Security notice
---------------

- The ``__str__()`` method of the ``SocialToken`` model returned the access
token. As a consequence, logging or printing tokens otherwise would expose the
access token. Now, the method no longer returns the token. If you want to
log/print tokens, you will now have to explicitly log the ``token`` field of
the ``SocialToken`` instance.


0.63.3 (2024-05-31)
Expand Down
2 changes: 1 addition & 1 deletion allauth/socialaccount/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class Meta:
verbose_name_plural = _("social application tokens")

def __str__(self):
return self.token
return "%s (%s)" % (self._meta.verbose_name, self.pk)


class SocialLogin(object):
Expand Down

0 comments on commit 663c7df

Please sign in to comment.