Fix bug accessing auth tokens

This commit is contained in:
Joshua Boniface 2020-01-29 16:04:03 -05:00
parent 8c59707cba
commit 43ddf5b709
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ def Authenticator(function):
return function(*args, **kwargs)
# Key header-based authentication
if 'X-Api-Key' in flask.request.headers:
if any(token for token in secret_tokens if flask.request.headers.get('X-Api-Key') == token):
if any(token for token in config['auth_tokens'] if flask.request.headers.get('X-Api-Key') == token.get('token')):
return function(*args, **kwargs)
else:
return {"message":"X-Api-Key Authentication failed"}, 401