feat(support#create): block with invisible captcha [avoid painful captcha]
This commit is contained in:
parent
ec6c71beea
commit
252eee272b
9 changed files with 87 additions and 42 deletions
|
@ -1,4 +1,6 @@
|
|||
class SupportController < ApplicationController
|
||||
invisible_captcha only: [:create], on_spam: :redirect_to_root
|
||||
|
||||
def index
|
||||
setup_context
|
||||
end
|
||||
|
@ -92,4 +94,8 @@ class SupportController < ApplicationController
|
|||
def email
|
||||
current_user&.email || params[:email]
|
||||
end
|
||||
|
||||
def redirect_to_root
|
||||
redirect_to root_path, alert: t('invisible_captcha.custom_message')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
= label_tag :type do
|
||||
= t('.your_question')
|
||||
= hidden_field_tag :type, params[:type]
|
||||
|
||||
= invisible_captcha
|
||||
|
||||
%dl
|
||||
- @options.each do |(question, question_type, link)|
|
||||
%dt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue