mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-06-28 08:14:17 +00:00
Fallback to the token auth, not none
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user