Allow allauth to properly store refresh tokens and expiry if provided

This commit is contained in:
Luke Burden 2019-08-20 16:02:25 -07:00
parent 624ad01afb
commit dd369bd01a

View File

@ -115,7 +115,11 @@ class SocialLoginSerializer(serializers.Serializer):
raise serializers.ValidationError(
_("Incorrect input. access_token or code is required."))
social_token = adapter.parse_token({'access_token': access_token})
# To allow allauth to store the refresh token as well as the access token, we
# make another minor adjustment, not yet in all-auth.
# https://github.com/Tivix/django-rest-auth/pull/486
# social_token = adapter.parse_token({'access_token': access_token})
social_token = adapter.parse_token(token)
social_token.app = app
try: