Skip to content

Commit

Permalink
update recaptcha conf
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Jan 30, 2025
1 parent e3ed51d commit 47ce787
Show file tree
Hide file tree
Showing 233 changed files with 45,915 additions and 159 deletions.
44 changes: 23 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/decidim/decidim.git
revision: bafe8f0ec14c5fe2b58462bef3035d710fc88219
revision: 5b3b8d61b1964c0581ed07025e610c5c365eac71
branch: release/0.28-stable
specs:
decidim (0.28.4)
Expand Down Expand Up @@ -59,6 +59,7 @@ GIT
cells-erb (~> 0.1.0)
cells-rails (~> 0.1.3)
charlock_holmes (~> 0.7)
concurrent-ruby (= 1.2.2)
date_validator (~> 0.12.0)
devise (~> 4.7)
devise-i18n (~> 1.2, < 1.11.1)
Expand Down Expand Up @@ -300,7 +301,7 @@ GEM
childprocess (5.1.0)
logger (~> 1.5)
commonmarker (0.23.11)
concurrent-ruby (1.3.4)
concurrent-ruby (1.2.2)
connection_pool (2.5.0)
crack (1.0.0)
bigdecimal
Expand All @@ -315,7 +316,7 @@ GEM
date_validator (0.12.0)
activemodel (>= 3)
activesupport (>= 3)
decidim-decidim_awesome (0.11.2)
decidim-decidim_awesome (0.11.3)
decidim-admin (>= 0.28.0, < 0.29)
decidim-core (>= 0.28.0, < 0.29)
deface (>= 1.5)
Expand All @@ -342,7 +343,7 @@ GEM
devise (>= 4.6)
diff-lcs (1.5.1)
diffy (3.4.3)
digest (3.1.1)
digest (3.2.0)
doc2text (0.4.7)
nokogiri (>= 1.13.2, < 1.17.0)
rubyzip (~> 2.3.0)
Expand Down Expand Up @@ -379,7 +380,7 @@ GEM
logger
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
ffi (1.15.5)
ffi (1.17.1)
file_validators (3.0.0)
activemodel (>= 3.2)
mime-types (>= 1.0)
Expand Down Expand Up @@ -423,7 +424,7 @@ GEM
activesupport (>= 2)
nokogiri (>= 1.4)
htmlentities (4.3.4)
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
activesupport (>= 4.0.2)
Expand Down Expand Up @@ -460,9 +461,10 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
launchy (3.0.1)
launchy (3.1.0)
addressable (~> 2.8)
childprocess (~> 5.0)
logger (~> 1.6)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (2.0.0)
Expand Down Expand Up @@ -531,8 +533,8 @@ GEM
rack-protection
omniauth-facebook (5.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-google-oauth2 (1.2.0)
jwt (>= 2.9)
omniauth-google-oauth2 (1.2.1)
jwt (>= 2.9.2)
oauth2 (~> 2.0)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8)
Expand All @@ -558,7 +560,7 @@ GEM
parallel (1.26.3)
parallel_tests (4.9.0)
parallel
parser (3.3.6.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pg (1.4.6)
Expand All @@ -577,7 +579,7 @@ GEM
psych (4.0.6)
stringio
public_suffix (6.0.1)
puma (6.5.0)
puma (6.6.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
Expand Down Expand Up @@ -616,9 +618,9 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (~> 1.14)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
Expand Down Expand Up @@ -689,7 +691,7 @@ GEM
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.37.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand Down Expand Up @@ -720,17 +722,17 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
selenium-webdriver (4.27.0)
selenium-webdriver (4.28.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.1.0)
sentry-rails (5.22.1)
sentry-rails (5.22.3)
railties (>= 5.0)
sentry-ruby (~> 5.22.1)
sentry-ruby (5.22.1)
sentry-ruby (~> 5.22.3)
sentry-ruby (5.22.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shakapacker (7.1.0)
Expand All @@ -742,7 +744,7 @@ GEM
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq-cron (2.0.1)
sidekiq-cron (2.1.0)
cronex (>= 0.13.0)
fugit (~> 1.8, >= 1.11.1)
globalid (>= 1.0.1)
Expand Down Expand Up @@ -775,8 +777,8 @@ GEM
stringio (3.1.2)
strscan (3.1.2)
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.3.2)
tilt (2.6.0)
timeout (0.4.3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ module RecaptchableSignUp
# https://developers.google.com/recaptcha/docs/verify
# https://developers.google.com/recaptcha/docs/display

RECAPTCHA_MINIMUM_SCORE = 0.5

# rubocop:disable Rails/LexicallyScopedActionFilter
before_action :verify_recaptcha, only: :create
# rubocop:enable Rails/LexicallyScopedActionFilter

private

def verify_recaptcha
token = params["g-recaptcha-response"]

secret_key = Rails.application.secrets[:recaptcha_secret_key]
return if secret_key.blank?

token = params["g-recaptcha-response"]

uri = URI.parse("https://www.google.com/recaptcha/api/siteverify?secret=#{secret_key}&response=#{token}")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- insert_after ".actions" -->
<!-- insert_before "erb[loud]:contains('invisible_captcha')" -->

<div class="mb-s">
<%= recaptcha_tag %>
Expand Down
Loading

0 comments on commit 47ce787

Please sign in to comment.