Move each flask module into a Blueprint and have CSRF protection only on the API blueprint
This commit is contained in:
parent
b598c7ec85
commit
310c98df50
8 changed files with 174 additions and 162 deletions
|
@ -1,7 +1,7 @@
|
|||
import logging
|
||||
import stripe
|
||||
|
||||
from flask import request, make_response
|
||||
from flask import request, make_response, Blueprint
|
||||
|
||||
from data import model
|
||||
from app import app
|
||||
|
@ -11,8 +11,9 @@ from util.email import send_invoice_email
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
webhooks = Blueprint('webhooks', __name__)
|
||||
|
||||
@app.route('/webhooks/stripe', methods=['POST'])
|
||||
@webhooks.route('/stripe', methods=['POST'])
|
||||
def stripe_webhook():
|
||||
request_data = request.get_json()
|
||||
logger.debug('Stripe webhook call: %s' % request_data)
|
||||
|
|
Reference in a new issue