from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response

class CustomObtainAuthToken(ObtainAuthToken):
    def post(self, request, *args, **kwargs):
        serializer = self.serializer_class(data=request.data, context={'request': request})
        serializer.is_valid(raise_exception=True)
        user = serializer.validated_data['user']
        response = super(CustomObtainAuthToken, self).post(request, *args, **kwargs)
        token = Token.objects.get(key=response.data['token'])
        return Response({
            'token': token.key,
            'name': user.username,
            'last-login:': user.last_login,
            'date-joined:': user.date_joined,
            'email': user.email,
        })
901b299c08ec5aeacf9224d613c48a35f3142483
<mask token>

<mask token>


class CustomObtainAuthToken(ObtainAuthToken):
    <mask token>

<mask token>


class CustomObtainAuthToken(ObtainAuthToken):

    def post(self, request, *args, **kwargs):
        serializer = self.serializer_class(data=request.data, context={
            'request': request})
        serializer.is_valid(raise_exception=True)
        user = serializer.validated_data['user']
        response = super(CustomObtainAuthToken, self).post(request, *args,
            **kwargs)
        token = Token.objects.get(key=response.data['token'])
        return Response({'token': token.key, 'name': user.username,
            'last-login:': user.last_login, 'date-joined:': user.
            date_joined, 'email': user.email})

from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response


class CustomObtainAuthToken(ObtainAuthToken):

    def post(self, request, *args, **kwargs):
        serializer = self.serializer_class(data=request.data, context={
            'request': request})
        serializer.is_valid(raise_exception=True)
        user = serializer.validated_data['user']
        response = super(CustomObtainAuthToken, self).post(request, *args,
            **kwargs)
        token = Token.objects.get(key=response.data['token'])
        return Response({'token': token.key, 'name': user.username,
            'last-login:': user.last_login, 'date-joined:': user.
            date_joined, 'email': user.email})

from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response

class CustomObtainAuthToken(ObtainAuthToken):
    def post(self, request, *args, **kwargs):
        serializer = self.serializer_class(data=request.data, context={'request': request})
        serializer.is_valid(raise_exception=True)
        user = serializer.validated_data['user']
        response = super(CustomObtainAuthToken, self).post(request, *args, **kwargs)
        token = Token.objects.get(key=response.data['token'])
        return Response({
            'token': token.key,
            'name': user.username,
            'last-login:': user.last_login,
            'date-joined:': user.date_joined,
            'email': user.email,
        })