We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad716ce commit 2bad302Copy full SHA for 2bad302
redash/security.py
@@ -1,6 +1,6 @@
1
import functools
2
3
-from flask import request, session
+from flask import session
4
from flask_login import current_user
5
from flask_talisman import talisman
6
from flask_wtf.csrf import CSRFProtect, generate_csrf
@@ -35,17 +35,6 @@ def inject_csrf_token(response):
35
36
@app.before_request
37
def check_csrf():
38
- # BEGIN workaround until https://github.com/lepture/flask-wtf/pull/419 is merged
39
- if request.blueprint in csrf._exempt_blueprints:
40
- return
41
-
42
- view = app.view_functions.get(request.endpoint)
43
- dest = f"{view.__module__}.{view.__name__}"
44
45
- if dest in csrf._exempt_views:
46
47
- # END workaround
48
49
if not current_user.is_authenticated or "user_id" in session:
50
csrf.protect()
51
0 commit comments