Skip to content

Allow CSRF to be entirely disabled #483

Open
@marksteward

Description

Thanks to SameSite-by-default cookies, CSRF protection is pretty much redundant these days. However, if I strip out the call to CSRFProtect.init_app, Flask-WTF still generates and inserts a csrf_token field into forms, even if WTF_CSRF_ENABLED is set to False.

Would you accept a PR to make it so that a project that never calls CSRFProtect.init_app leaves csrf, csrf_class, and csrf_context as their empty defaults?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions