Resolve angular dev auth warnings

This commit is contained in:
shamoon 2024-11-30 10:27:46 -08:00
parent 1cadc034bd
commit 178d568574
2 changed files with 14 additions and 0 deletions

View File

@ -28,4 +28,6 @@ class DocumentsConfig(AppConfig):
document_consumption_finished.connect(run_workflows_added)
document_updated.connect(run_workflows_updated)
import documents.schema # noqa: F401
AppConfig.ready(self)

12
src/documents/schema.py Normal file
View File

@ -0,0 +1,12 @@
from drf_spectacular.extensions import OpenApiAuthenticationExtension
class AngularApiAuthenticationOverrideScheme(OpenApiAuthenticationExtension):
target_class = "paperless.auth.AngularApiAuthenticationOverride"
name = "AngularApiAuthenticationOverride"
def get_security_definition(self, auto_schema):
return {
"name": "Angular Authorization",
"description": "Automatic Angular authentication for the dev server",
}