Skip to content

Commit

Permalink
Merge pull request #590 from PecanProject/recaptcha-fix
Browse files Browse the repository at this point in the history
recaptcha update
  • Loading branch information
gsrohde authored Jun 18, 2018
2 parents 7d394a4 + fafe9d7 commit c7f98a8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<em>* Any request for page access higher then Viewer or data access higher then External researcher must be approved by an administrator</em>

<% if Rails.env != "test" %>
<%= recaptcha_tags ssl: true %>
<%= recaptcha_tags %>
<% end %>

<div class="form-actions">
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/recaptcha.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Recaptcha.configure do |config|
config.public_key = '6Ld5M9kSAAAAAK7eXugwXriDcyIOvl3V1NVyiXl9'
config.private_key = '6Ld5M9kSAAAAAFBmB5WmUHoyLIcKDxAasvFp_uCz'
config.site_key = '6Lch410UAAAAAEhnOjVOv01AhJlpVZccr1Icab0W'
config.secret_key = '6Lch410UAAAAAFnuVX_RaI9-gRcjnG2o7ijtyUny'
end

0 comments on commit c7f98a8

Please sign in to comment.