How can I return the refresh token when using social auth? I tried this solution here I don't know how to make this compatible with graphql.
Here is my attempt:
import graphql_social_auth
from graphql_jwt.shortcuts import get_token
class SocialAuth(graphql_social_auth.SocialAuthJWT):
refresh_token = graphene.String()
token = graphene.String()
@classmethod
def resolve(cls, root, info, social, **kwargs):
return cls(
user=social.user,
token=get_token(social.user),
refresh_token=social.extra_data['refresh_token']
)
The user and token fields are alright when I comment out the refresh token. I just don't know where to get the refresh token, it seems to be not in the extra_data.
I am already dealing with this problem for hours and all the search results are no help. Please, any guidance is really appreciated.