[webhooks] Fix auth for Emacs webhooks
This commit is contained in:
@ -6,7 +6,7 @@ from django.views.decorators.csrf import csrf_exempt
|
|||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from profiles.models import UserProfile
|
from profiles.models import UserProfile
|
||||||
from rest_framework import status
|
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.exceptions import AuthenticationFailed
|
||||||
from rest_framework.permissions import IsAuthenticated
|
from rest_framework.permissions import IsAuthenticated
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
@ -187,6 +187,9 @@ class TodoistWebhookView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
class EmacsWebhookView(APIView):
|
class EmacsWebhookView(APIView):
|
||||||
|
authentication_classes = [TokenAuthentication]
|
||||||
|
permission_classes = [IsAuthenticated]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def logger(self):
|
def logger(self):
|
||||||
return logger
|
return logger
|
||||||
|
|||||||
Reference in New Issue
Block a user