Added the before_request so that all calls must have a valid token.

Next is to get all the rest tests to pass again.
This commit is contained in:
Rebecca Law
2016-01-14 17:45:30 +00:00
parent 37b571235f
commit 5f59b631e1
5 changed files with 130 additions and 142 deletions

View File

@@ -46,6 +46,13 @@ def init_app(app):
if key in os.environ:
app.config[key] = convert_to_boolean(os.environ[key])
@app.before_request
def required_authentication():
from app.authentication import auth
error = auth.requires_auth()
if error:
return error
def convert_to_boolean(value):
"""Turn strings to bools if they look like them