diff --git a/Gemfile b/Gemfile index bb944a6b..63850688 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem 'pg', '~> 1.4' gem 'json_translate', '~> 4.0.0' gem 'devise', '~> 4.9.1' gem 'devise-i18n', '~> 1.11.0' +gem 'invisible_captcha', '~> 2.3.0' gem 'http_accept_language', '~> 2.1.1' gem 'kaminari', '~> 1.2.1' gem 'simple_form', '~> 5.0.2' diff --git a/Gemfile.lock b/Gemfile.lock index dfe6a661..c36831f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,6 +183,8 @@ GEM has_scope (>= 0.6) railties (>= 6.0) responders (>= 2) + invisible_captcha (2.3.0) + rails (>= 5.2) jmespath (1.6.2) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) @@ -450,6 +452,7 @@ DEPENDENCIES has_scope (~> 0.7.2) http_accept_language (~> 2.1.1) image_processing (~> 1.12) + invisible_captcha (~> 2.3.0) jquery-rails (~> 4.4.0) json_translate (~> 4.0.0) kaminari (~> 1.2.1) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 689adef3..4ce00906 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,6 +3,8 @@ class UsersController < ApplicationController before_action :user_should_be_confirmed, except: %i[signup create please_confirm] before_action :member_should_exist_and_be_active, except: %i[signup create edit show update please_confirm] + invisible_captcha if: -> { params[:from_signup].present? } + has_scope :tagged_with, as: :tag def index diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 56118ff5..02a25a05 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,6 +1,7 @@ <%= show_error_messages!(@user) %> <%= simple_form_for @user do |f| %> <%= f.hidden_field :locale, value: I18n.locale %> + <%= invisible_captcha %>