Skip to content

Commit

Permalink
chg: [security] Enable CSRF protection globally.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Jul 14, 2024
1 parent c0ab1cd commit f1c9190
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mosp/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from flask_cors import CORS
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
from werkzeug.routing import BaseConverter
from werkzeug.routing import ValidationError

Expand Down Expand Up @@ -74,9 +75,12 @@ def set_logging(
except Exception:
application.config.from_pyfile("development.py", silent=False)

# Database and migration
db = SQLAlchemy(application)
migrate = Migrate(application, db)

# Enable CSRF protection globally
csrf = CSRFProtect(application)

cors = CORS(
application,
Expand All @@ -86,7 +90,6 @@ def set_logging(
},
)


# i18n and l10n support
def get_locale():
# if a user is logged in, use the locale from the user settings
Expand Down

0 comments on commit f1c9190

Please sign in to comment.