The CSRF token is missing when enabled CsrfProtect
wanghaiqing2015 opened this issue · comments
wanghaiqing2015 commented
from flask_wtf import CsrfProtect
CsrfProtect(app)
from flask_jsonrpc import JSONRPC
jsonrpc = JSONRPC(app, '/JOB/script/call/jsonrpc2')
@jsonrpc.method('create_script_interface')
def get( ):
pass
the result is :
<title>400 Bad Request</title>Bad Request
The CSRF token is missing.
Vasiliy Taranov commented
This helped for me:
csrf_protect = CsrfProtect(app)
csrf_protect.exempt('flask_jsonrpc.wrapper')