Skip to content

Commit

Permalink
Do not even try to authenticate if settings are missing or the user i…
Browse files Browse the repository at this point in the history
…s not in settings.
  • Loading branch information
johanlundberg committed Oct 23, 2014
1 parent b7d9314 commit 87deafa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions meetingtools/apps/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ def groups(request):
def report_auth(request):
auth_data = request.META.get('HTTP_X_REPORT_AUTH', None)
if auth_data and ':' in auth_data:
report_users = getattr(django_settings, 'REPORT_USERS')
requester, key = auth_data.split(':')
if report_users[requester]['key'] == key:
return report_users[requester]
try:
report_users = getattr(django_settings, 'REPORT_USERS')
requester, key = auth_data.split(':')
if report_users[requester]['key'] == key:
return report_users[requester]
except (AttributeError, KeyError):
pass
return False

0 comments on commit 87deafa

Please sign in to comment.