Browse Source

Add warning for unknown REMOTE_USER_HEADER_TYPE

pull/457/head
Shea Polansky 4 years ago
committed by Pēteris Caune
parent
commit
1fd87aae35
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      hc/settings.py

+ 4
- 1
hc/settings.py View File

@ -60,7 +60,10 @@ INSTALLED_APPS = (
REMOTE_USER_HEADER = os.getenv("REMOTE_USER_HEADER", "AUTH_USER") REMOTE_USER_HEADER = os.getenv("REMOTE_USER_HEADER", "AUTH_USER")
REMOTE_USER_HEADER_TYPE = os.getenv("REMOTE_USER_HEADER_TYPE", "").upper() REMOTE_USER_HEADER_TYPE = os.getenv("REMOTE_USER_HEADER_TYPE", "").upper()
if REMOTE_USER_HEADER_TYPE not in ["EMAIL", "ID"]: REMOTE_USER_HEADER_TYPE = None
if REMOTE_USER_HEADER_TYPE not in ["EMAIL", "ID", ""]:
warnings.warn(f"Unknown REMOTE_USER_HEADER_TYPE '{REMOTE_USER_HEADER_TYPE}'! header-based authentication has been disabled.")
REMOTE_USER_HEADER_TYPE = None
if REMOTE_USER_HEADER_TYPE == "": REMOTE_USER_HEADER_TYPE = None
MIDDLEWARE = ( MIDDLEWARE = (
"django.middleware.security.SecurityMiddleware", "django.middleware.security.SecurityMiddleware",


Loading…
Cancel
Save