]> git.gir.st - subscriptionfeed.git/blob - app/anticaptcha/__init__.py
[WARNING: CONFIG CHANGE] reorganize webhooks config
[subscriptionfeed.git] / app / anticaptcha / __init__.py
1 from flask import Blueprint, request, g, url_for
2 from werkzeug.exceptions import NotFound
3 from urllib.parse import urljoin
4 import json
5 import sqlite3
6 import requests
7
8 from ..common.common import cf
9 from ..common.anticsrf import no_csrf_protection
10
11 from .lib import solve_captcha
12
13 frontend = Blueprint("anticaptcha", __name__)
14
15 @frontend.before_app_request
16 def inject_header_item(): # makes a submodule accessible.
17 pass
18
19 @frontend.route("/captcha_response/<nonce>", methods=["POST"])
20 @no_csrf_protection
21 def captcha_response(nonce):
22 solve_captcha(nonce, request.json)
23 return "", 204
Imprint / Impressum