Skip to content

Commit

Permalink
middleware Don't pop the CSRF from the session
Browse files Browse the repository at this point in the history
We may need the value for future submissions. Fixes issue pwyf#41
  • Loading branch information
michaelwood committed Oct 29, 2019
1 parent 73988ea commit f267e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DataQualityTester/lib/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@app.before_request
def csrf_protect():
if request.method == 'POST':
token = session.pop('_csrf_token', None)
token = session.get('_csrf_token', None)
if not token or token != request.form.get('_csrf_token'):
abort(403)

Expand Down

0 comments on commit f267e6b

Please sign in to comment.