title: Allauth Social Login with DRF JWT
body: <p>I am using DRF, DRF-JWT, Allauth and Res-auth, and djangorestframework-jwt-refresh-token in my Django Application.</p>
  
  <p>I have a custom JWT Register Serializer to collect some additional user info and create and create a refresh-token that is used to refresh expired JWT tokens. We have that working across back-end and iOS Application with no problems for email signup. I am now trying to implement the JWT with the sociallogin element of allauth in particular Facebook as a provider.</p>
  
  <p>I can create a refresh token against a Facebook user by overriding the DefaultSocialAccountAdapter but I'm struggling to return a JSON response with a JWT with said refresh token to mobile client.</p>
  
  <p>This creates refresh token:</p>
  
  <pre><code>class CustomSocialAccountAdapter(DefaultSocialAccountAdapter):
      def save_user(self, request, sociallogin, form):
      user = super(CustomSocialAccountAdapter, self).save_user(request, sociallogin, form)
      app = 'users'
      user.refresh_tokens.create(app=app)
      return user
  </code></pre>
  
  <p>I can create JWT manually with this:</p>
  
  <pre><code>jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
  jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER
  
  payload = jwt_payload_handler(user)
  token = jwt_encode_handler(payload)
  </code></pre>
  
  <p>I'm just having difficulty putting it all together, should I be overriding the adapter or using pre_social_login signal.</p>
  
  <p>Any pointers appreciated.</p>