-
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abstract protect_csrf() into a separate method.
Right now, CsrfProtect._csrf_protect() does 1) check if this view should be checked for a CSRF token, and 2) validate the actual token. This commit abstracts 2) into a separate method so we can manually call this method (for example on a before_request callback). This makes it possible to do further checks before validating the CSRF (e.g. skip the check for REST calls using OAuth). This commit also adds a configuration parameter WTF_CSRF_CHECK_DEFAULT, which will determine whether to check all views by default or not. It defaults to True.
- Loading branch information
Showing
2 changed files
with
66 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters