omab/django-social-auth — pull request #767 by marselester (2013-09-06 16:10:16+00:00)
Title: It fixes losing of "access" or "refresh" tokens issue

Let's assume that we have just signed in with GitHub:

>>> github_user.extra_data
{u'access_token': u'my access token', u'expires': None, u'id': 666}
>>> github_user.refresh_token()
>>> github_user.extra_data
{u'access_token': '', u'expires': None, u'id': None}

GitHub responded ``{u'error': u'bad_verification_code'}`` and ``refresh_token()`` lost ``access_token``, ``id``.

One more example:

>>> odnoklassniki_user.extra_data
{u'access_token': u'my access token', u'expires': None, u'refresh_token': u'my refresh token'}
>>> odnoklassniki_user.refresh_token()
>>> odnoklassniki_user.extra_data
{u'access_token': u'new access token', u'expires': None, u'refresh_token': None}
>>> odnoklassniki_user.refresh_token()
>>> odnoklassniki_user.extra_data
{u'access_token': '', u'expires': None, u'refresh_token': None}

Odnoklassniki responded ``{u'access_token': u'new access token', u'token_type': u'session'}`` and ``refresh_token()`` lost ``refresh_token`` and then ``access_token``.