mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 08:55:15 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user