Fallback to the token auth, not none

This commit is contained in:
shamoon
2026-03-16 07:38:29 -07:00
parent a0dd7a1506
commit 53073bc5ad
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class TestSystemStatus(APITestCase):
"""
response = self.client.get(self.ENDPOINT)
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertNotIn("WWW-Authenticate", response)
self.assertEqual(response["WWW-Authenticate"], "Token")
normal_user = User.objects.create_user(username="normal_user")
self.client.force_login(normal_user)
response = self.client.get(self.ENDPOINT)
+2 -1
View File
@@ -89,4 +89,5 @@ class PaperlessBasicAuthentication(authentication.BasicAuthentication):
if auth_header.lower().startswith("basic "):
return super().authenticate_header(request)
return None
# Still 401 for anonymous API access
return authentication.TokenAuthentication.keyword