[scrobbles] Use Bearer token keyword
This commit is contained in:
@ -14,6 +14,15 @@ from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
|||||||
from django.db.models import Count, Max, Q
|
from django.db.models import Count, Max, Q
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from rest_framework.authentication import TokenAuthentication
|
from rest_framework.authentication import TokenAuthentication
|
||||||
|
from rest_framework.authtoken.views import ObtainAuthToken
|
||||||
|
from rest_framework.authtoken.models import Token
|
||||||
|
from rest_framework.permissions import IsAuthenticated
|
||||||
|
|
||||||
|
|
||||||
|
class BearerTokenAuthentication(TokenAuthentication):
|
||||||
|
keyword = "Bearer"
|
||||||
|
|
||||||
|
|
||||||
from django.http import (
|
from django.http import (
|
||||||
FileResponse,
|
FileResponse,
|
||||||
Http404,
|
Http404,
|
||||||
@ -84,7 +93,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class WebhookView(APIView):
|
class WebhookView(APIView):
|
||||||
permission_classes = [IsAuthenticated]
|
permission_classes = [IsAuthenticated]
|
||||||
authentication_classes = [TokenAuthentication]
|
authentication_classes = [BearerTokenAuthentication]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def logger(self):
|
def logger(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user