Skip to content

Commit

Permalink
Disable CSRF check.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jzohrab committed Aug 26, 2024
1 parent 0348e03 commit 593761c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lute/app_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ def _create_app(app_config, extra_config):
# ref https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/
# Don't track mods.
"SQLALCHEMY_TRACK_MODIFICATIONS": False,
# Disable CSRF -- this is a local app, and it's highly
# unlikely that a malicious site will try to hack anyone's Lute data.
# ref https://stackoverflow.com/questions/5207160/
# what-is-a-csrf-token-what-is-its-importance-and-how-does-it-work
"WTF_CSRF_ENABLED": False,
}

final_config = {**config, **extra_config}
Expand Down

0 comments on commit 593761c

Please sign in to comment.