Enable csrf protection on register form

Closes #34
master
Steven Loria 8 years ago
parent 525ad8d8b0
commit 16a789bf0c
No known key found for this signature in database
GPG Key ID: 1655D1A1BDFBA4D7
  1. 2
      {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/public/views.py

@ -46,7 +46,7 @@ def logout():
@blueprint.route('/register/', methods=['GET', 'POST']) @blueprint.route('/register/', methods=['GET', 'POST'])
def register(): def register():
"""Register new user.""" """Register new user."""
form = RegisterForm(request.form, csrf_enabled=False) form = RegisterForm(request.form)
if form.validate_on_submit(): if form.validate_on_submit():
User.create(username=form.username.data, email=form.email.data, password=form.password.data, active=True) User.create(username=form.username.data, email=form.email.data, password=form.password.data, active=True)
flash('Thank you for registering. You can now log in.', 'success') flash('Thank you for registering. You can now log in.', 'success')

Loading…
Cancel
Save