mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 15:25:41 +01:00
Updating changes to allow for disabling login
This commit is contained in:
parent
7f97716ae9
commit
516bc48a33
3 changed files with 18 additions and 3 deletions
|
|
@ -78,12 +78,14 @@ if os.getenv("PAPERLESS_INSTALLED_APPS"):
|
|||
INSTALLED_APPS += os.getenv("PAPERLESS_INSTALLED_APPS").split(",")
|
||||
|
||||
|
||||
#Default Django authentication middleware (requires a username/password)
|
||||
AUTH_CLASSES = [\
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware']
|
||||
|
||||
if bool(os.getenv("PAPERLESS_DISABLE_AUTH","true").lower() in ("yes", "y", "1", "t", "true")):
|
||||
AUTH_CLASSES = ['auto_auth.Middleware']
|
||||
#If AUTH is disabled, we just use our "bypass" authentication middleware
|
||||
if bool(os.getenv("PAPERLESS_DISABLE_LOGIN","false").lower() in ("yes", "y", "1", "t", "true")):
|
||||
AUTH_CLASSES = ['paperless.auto_auth.Middleware']
|
||||
|
||||
MIDDLEWARE_CLASSES = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue