From dd369bd01ac3aa38be98df2b90c0090b07273934 Mon Sep 17 00:00:00 2001 From: Luke Burden Date: Tue, 20 Aug 2019 16:02:25 -0700 Subject: [PATCH] Allow allauth to properly store refresh tokens and expiry if provided --- rest_auth/registration/serializers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 4f99c18..266dcdc 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -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: