Add initial support for CSRF token protection

This commit is contained in:
Lance Edgar 2016-12-14 15:41:15 -06:00
parent 11e78adaab
commit ab09314ed3
8 changed files with 61 additions and 6 deletions

View file

@ -1,6 +1,7 @@
## -*- coding: utf-8 -*-
<div class="form">
${h.form(form.action_url, id=form.id or None, method='post', enctype='multipart/form-data')}
${form.csrf_token()}
${form.render_fields()|n}

View file

@ -17,6 +17,7 @@
<div class="form">
${form.begin(**{'data-ajax': 'false'})}
${form.hidden('referrer', value=referrer)}
${form.csrf_token()}
${form.field_div('username', form.text('username'))}
${form.field_div('password', form.password('password'))}

View file

@ -326,6 +326,7 @@
<div class="form-wrapper">
${form.begin(id='receiving-form')}
${form.csrf_token()}
${h.hidden('mode')}
${h.hidden('expiration_date')}
${h.hidden('ordered_product')}