@api_view(['POST'])
def refresh_tau_token(request):
    if (not request.user.is_authenticated):
        return JsonResponse({'error': 'You must be logged into access this endpoint.'})
    else:
        token = Token.objects.get(user=request.user)
        token.delete()
        token = Token.objects.create(user=request.user)
        return JsonResponse({'token': token.key})
@api_view(['POST'])
def refresh_tau_token(request):
    if (not request.user.is_authenticated):
        return JsonResponse({'error': 'You must be logged into access this endpoint.'})
    else:
        token = Token.objects.get(user=request.user)
        token.delete()
        token = Token.objects.create(user=request.user)
        return JsonResponse({'token': token.key})