-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added testing to /tf-setup - there wasn't any CSRF issue - all working. CSRF handling is complex and there are few unit tests. - Added @pytest.mark.csrf to make it easier to turn on and test CSRF w/o lots of boilerplate - Added tests and improved many templates to show CSRF errors - mostly for developers - but otherwise CSRF errors tent do just disappear and are difficult to debug - Found issue with WTFforms with the new form-level errors - it uses a `None` key - which, if there are multiple errors, isn't sortable by Flasks default JSON serializer. Filed issue and now change if from `None` to "" - Fixed issue in webauthn with CSRF errors causing exceptions - added tests. - In the case of CSRFprotect() (the app configuring CSRF for the entire app) a CSRF error would raise an exception which would always return an HTML response - added code to return a JSON response if desired. closes #905
- Loading branch information
Showing
24 changed files
with
332 additions
and
122 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
{% extends "security/base.html" %} | ||
{% from "security/_macros.html" import render_field_with_errors, render_field %} | ||
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, render_form_errors %} | ||
|
||
{% block content %} | ||
{% include "security/_messages.html" %} | ||
<h1>{{ _fsdomain('Change password') }}</h1> | ||
<form action="{{ url_for_security('change_password') }}" method="post" name="change_password_form"> | ||
{{ change_password_form.hidden_tag() }} | ||
{{ render_form_errors(change_password_form) }} | ||
{% if active_password %} | ||
{{ render_field_with_errors(change_password_form.password) }} | ||
{% else %} | ||
<h3>{{ _fsdomain('You do not currently have a password - this will add one.') }}</h3> | ||
{% endif %} | ||
{{ render_field_with_errors(change_password_form.new_password) }} | ||
{{ render_field_with_errors(change_password_form.new_password_confirm) }} | ||
{{ render_field_errors(change_password_form.csrf_token) }} | ||
{{ render_field(change_password_form.submit) }} | ||
</form> | ||
{% endblock content %} |
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
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
Oops, something went wrong.