From 3058bfdd22bf06a4cd59658e4ba2d7b38d4293f7 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 31 Mar 2026 14:31:13 -0400 Subject: [PATCH] [scrobbles] Use Bearer token keyword --- vrobbler/apps/scrobbles/views.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 17a2835..cb7a761 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -14,6 +14,15 @@ from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.db.models import Count, Max, Q from django.db.models.query import QuerySet 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 ( FileResponse, Http404, @@ -84,7 +93,7 @@ logger = logging.getLogger(__name__) class WebhookView(APIView): permission_classes = [IsAuthenticated] - authentication_classes = [TokenAuthentication] + authentication_classes = [BearerTokenAuthentication] @property def logger(self):