Refactor and fix auth errors

This commit is contained in:
Ken Tsang
2017-03-22 10:54:15 +00:00
parent b81d789307
commit 8e5266e89b
4 changed files with 16 additions and 11 deletions

View File

@@ -147,17 +147,22 @@ def register_blueprint(application):
def register_v2_blueprints(application):
from app.v2.notifications.post_notifications import notification_blueprint as post_notifications
from app.v2.notifications.get_notifications import notification_blueprint as get_notifications
from app.v2.template.get_template import template_blueprint as get_template
from app.v2.template.post_template import template_blueprint as post_template
from app.v2.notifications.post_notifications import v2_notification_blueprint as post_notifications
from app.v2.notifications.get_notifications import v2_notification_blueprint as get_notifications
from app.v2.template.get_template import v2_template_blueprint as get_template
from app.v2.template.post_template import v2_template_blueprint as post_template
from app.authentication.auth import requires_auth
post_notifications.before_request(requires_auth)
application.register_blueprint(post_notifications)
get_notifications.before_request(requires_auth)
application.register_blueprint(get_notifications)
get_template.before_request(requires_auth)
application.register_blueprint(get_template)
post_template.before_request(requires_auth)
application.register_blueprint(post_template)