diff --git a/vrobbler/apps/tasks/webhooks.py b/vrobbler/apps/tasks/webhooks.py index 39a2c3f..d8fd563 100644 --- a/vrobbler/apps/tasks/webhooks.py +++ b/vrobbler/apps/tasks/webhooks.py @@ -6,7 +6,7 @@ from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator from profiles.models import UserProfile from rest_framework import status -from rest_framework.authentication import BaseAuthentication +from rest_framework.authentication import BaseAuthentication, TokenAuthentication from rest_framework.exceptions import AuthenticationFailed from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response @@ -187,6 +187,9 @@ class TodoistWebhookView(APIView): class EmacsWebhookView(APIView): + authentication_classes = [TokenAuthentication] + permission_classes = [IsAuthenticated] + @property def logger(self): return logger