protect against bots with timeouts

This commit is contained in:
2015-10-06 09:16:07 +02:00
parent 99390a5e5a
commit b381cbf066
9 changed files with 56 additions and 2 deletions
+4 -2
View File
@@ -1,14 +1,16 @@
class SupportersController < ApplicationController
before_filter :set_form_timestamp, only: :new
def new
@supporter = Supporter.new
end
def create
@supporter = Supporter.new supporter_form_params
if @supporter.save
if !input_to_fast? && @supporter.save
redirect_to thanks_path
else
flash.now[:danger] = t 'shared.actions.failed'
flash.now[:danger] = t '.timeout' if input_to_fast?
render :new
end
end