Skip to content

Commit 593761c

Browse files
committed
Disable CSRF check.
CSRF is vital for financial apps, as it prevents bad sites from trying to send anonymous requests to them, but Lute is just a local thing running on a port. Zero security risk, IMO.
1 parent 0348e03 commit 593761c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lute/app_factory.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ def _create_app(app_config, extra_config):
303303
# ref https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/
304304
# Don't track mods.
305305
"SQLALCHEMY_TRACK_MODIFICATIONS": False,
306+
# Disable CSRF -- this is a local app, and it's highly
307+
# unlikely that a malicious site will try to hack anyone's Lute data.
308+
# ref https://stackoverflow.com/questions/5207160/
309+
# what-is-a-csrf-token-what-is-its-importance-and-how-does-it-work
310+
"WTF_CSRF_ENABLED": False,
306311
}
307312

308313
final_config = {**config, **extra_config}

0 commit comments

Comments
 (0)