title: ObtainAuthToken post function customization. How to get token and name in the response?
body: <p>I´m trying to get response that include name apart from token.
  In the documentation <a href="https://www.django-rest-framework.org/api-guide/authentication/" rel="nofollow noreferrer">https://www.django-rest-framework.org/api-guide/authentication/</a> about <strong>ObtainAuthToken</strong> I see we can overwrite the post fn but I´m not sure how to apply it in my CreateTokenView class.</p>
  <p>serializers.py</p>
  <pre><code>class AuthTokenSerializer(serializers.Serializer):
      &quot;&quot;&quot;Serializer for the user authentication object&quot;&quot;&quot;
      email = serializers.CharField()
      password = serializers.CharField(
          style={'input_type': 'password'},
          trim_whitespace=False
      )
  
      def validate(self,attrs):
          &quot;&quot;&quot;Overwriting the validate() fn&quot;&quot;&quot;
          email = attrs.get('email')
          password = attrs.get('password')
  
          user = authenticate(
              request=self.context.get('request'),
              username=email,
              password=password
          )
          if not user:
              msg = _('Unable to authenticate with provided credentials')
              raise serializers.ValidationError(msg, code='authentication')
  
          attrs['user'] = user
          return attrs 
  </code></pre>
  <p>views.py</p>
  <pre><code>from rest_framework.authtoken.views import ObtainAuthToken
  
  class CreateTokenView(ObtainAuthToken):
      &quot;&quot;&quot;Create a new auth token for user&quot;&quot;&quot;
      serializer_class = AuthTokenSerializer
      renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES
  </code></pre>