mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
added setting PAPERLESS_AUTO_LOGIN_USERNAME
This commit is contained in:
parent
09e419aeee
commit
f4013b1343
5 changed files with 92 additions and 52 deletions
|
|
@ -144,6 +144,15 @@ TEMPLATES = [
|
|||
# Security #
|
||||
###############################################################################
|
||||
|
||||
AUTO_LOGIN_USERNAME = os.getenv("PAPERLESS_AUTO_LOGIN_USERNAME")
|
||||
|
||||
if AUTO_LOGIN_USERNAME:
|
||||
_index = MIDDLEWARE.index('django.contrib.auth.middleware.AuthenticationMiddleware')
|
||||
# This overrides everything the auth middleware is doing but still allows
|
||||
# regular login in case the provided user does not exist.
|
||||
MIDDLEWARE.insert(_index+1, 'paperless.auth.AutoLoginMiddleware')
|
||||
|
||||
|
||||
if DEBUG:
|
||||
X_FRAME_OPTIONS = ''
|
||||
# this should really be 'allow-from uri' but its not supported in any mayor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue