From a6f08a271a441cd03600719e636a2f051098df17 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Sun, 10 Jun 2018 16:30:05 -0500 Subject: [PATCH 1/2] recaptcha update Update to latest version of recaptcha. future should remove hard coded recaptcha keys and use environment variables. --- Gemfile | 2 +- Gemfile.lock | 5 +++-- app/controllers/users_controller.rb | 2 +- app/views/users/new.html.erb | 2 +- config/initializers/recaptcha.rb | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 48345bbd6..a7577b585 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem "json" gem "rgeo", "~> 0.5.0" gem "multi_json", "1.3.6" gem "railroad", "0.5.0" -gem "recaptcha", "0.3.4", :require => "recaptcha/rails" +gem "recaptcha", "4.8.0", :require => "recaptcha/rails" gem "ruby-graphviz", "1.0.8" gem "safe_attributes" gem "seer", "0.10.0" diff --git a/Gemfile.lock b/Gemfile.lock index 56820fce7..83f34285e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -154,7 +154,8 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (12.3.0) - recaptcha (0.3.4) + recaptcha (4.8.0) + json rgeo (0.5.3) rgeo-activerecord (4.0.5) activerecord (~> 4.2) @@ -241,7 +242,7 @@ DEPENDENCIES railroad (= 0.5.0) rails (= 4.2.10) rails3-restful-authentication (~> 3.0.1) - recaptcha (= 0.3.4) + recaptcha (= 4.8.0) rgeo (~> 0.5.0) rspec-rails (~> 3.0) rspec_api_documentation diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1759f0241..d76604555 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -46,7 +46,7 @@ def create if Rails.env == "test" success = @user && @user.save else - success = verify_recaptcha(:model => @user, :message => "Please re-enter the words from the image again.") && @user && @user.save + success = verify_recaptcha(:model => @user) && @user && @user.save end if success && @user.errors.empty? diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 6398e1d63..a8148643e 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -76,7 +76,7 @@ * Any request for page access higher then Viewer or data access higher then External researcher must be approved by an administrator <% if Rails.env != "test" %> - <%= recaptcha_tags ssl: true %> + <%= recaptcha_tags %> <% end %>
diff --git a/config/initializers/recaptcha.rb b/config/initializers/recaptcha.rb index 8b1007d78..6435c8598 100644 --- a/config/initializers/recaptcha.rb +++ b/config/initializers/recaptcha.rb @@ -1,4 +1,4 @@ Recaptcha.configure do |config| - config.public_key = '6Ld5M9kSAAAAAK7eXugwXriDcyIOvl3V1NVyiXl9' - config.private_key = '6Ld5M9kSAAAAAFBmB5WmUHoyLIcKDxAasvFp_uCz' + config.site_key = '6Ld5M9kSAAAAAK7eXugwXriDcyIOvl3V1NVyiXl9' + config.secret_key = '6Ld5M9kSAAAAAFBmB5WmUHoyLIcKDxAasvFp_uCz' end From fafe9d7aef4d48c29454c0b16228c28bb1c3772d Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Thu, 14 Jun 2018 15:02:52 -0500 Subject: [PATCH 2/2] Update recaptcha.rb update recaptcha keys --- config/initializers/recaptcha.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/recaptcha.rb b/config/initializers/recaptcha.rb index 6435c8598..bf0a3799a 100644 --- a/config/initializers/recaptcha.rb +++ b/config/initializers/recaptcha.rb @@ -1,4 +1,4 @@ Recaptcha.configure do |config| - config.site_key = '6Ld5M9kSAAAAAK7eXugwXriDcyIOvl3V1NVyiXl9' - config.secret_key = '6Ld5M9kSAAAAAFBmB5WmUHoyLIcKDxAasvFp_uCz' + config.site_key = '6Lch410UAAAAAEhnOjVOv01AhJlpVZccr1Icab0W' + config.secret_key = '6Lch410UAAAAAFnuVX_RaI9-gRcjnG2o7ijtyUny' end