diff --git a/authapp/views.py b/authapp/views.py index 7185442..d0a5ea2 100644 --- a/authapp/views.py +++ b/authapp/views.py @@ -17,7 +17,7 @@ class CustomAuthToken(ObtainAuthToken): def post(self, request, *args, **kwargs): response = super().post(request, *args, **kwargs) token = Token.objects.get(key=response.data['token']) - return Response({'token': token.key, 'user_id': token.user_id}) + return Response({'token': token.key, 'user_id': token.user_id, 'username': token.user.username}) class RegenerateTokenView(APIView): permission_classes = [IsAuthenticated]