Merge pull request #445 from sartography/fix-login-590

Fix login method so dhf8r isn't always logged in #590
This commit is contained in:
Dan Funk 2022-01-24 16:33:55 -05:00 committed by GitHub
commit 22498d6663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,7 @@ CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default
TESTING = environ.get('TESTING', default="false") == "true"
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true")
TEST_UID = environ.get('TEST_UID', default="dhf8r")
DEFAULT_UID = environ.get('DEFAULT_UID', default="dhf8r")
ADMIN_UIDS = re.split(r',\s*', environ.get('ADMIN_UIDS', default="dhf8r,ajl2j,cah3us,cl3wf"))
# Sentry flag

View File

@ -171,6 +171,9 @@ def login(
# If we're in production, override any uid with the uid from the SSO request headers
if _is_production():
uid = _get_request_uid(request)
else:
if not app.config['TESTING']:
uid = app.config['DEFAULT_UID']
if uid:
app.logger.info("SSO_LOGIN: Full URL: " + request.url)