summaryrefslogtreecommitdiff
path: root/src/jwebmail/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/jwebmail/__init__.py')
-rw-r--r--src/jwebmail/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 58bc8d5..88309ff 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -7,6 +7,7 @@ from babel import parse_locale
from flask import Flask, abort, g, redirect, url_for
from flask_babel import Babel, get_locale
from flask_login import LoginManager, login_required
+from flask_wtf.csrf import CSRFProtect
from jinja2 import ChainableUndefined
from werkzeug.middleware.proxy_fix import ProxyFix
@@ -34,7 +35,9 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.2.1.dev1"
+__version__ = "2.2.1.dev2"
+
+csrf = CSRFProtect()
def validate_config(app):
@@ -67,6 +70,8 @@ def create_app():
validate_config(app)
+ csrf.init_app(app)
+
babel = Babel(app, locale_selector=lambda: g.get("lang_code"))
app.cli.add_command(compile_css_command)