configures recaptcha
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -35,6 +35,7 @@ gem 'acts-as-taggable-on'
|
||||
gem "responders"
|
||||
gem 'foundation-rails'
|
||||
gem 'acts_as_votable'
|
||||
gem "recaptcha", :require => "recaptcha/rails"
|
||||
|
||||
group :development, :test do
|
||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||
|
||||
@@ -137,6 +137,7 @@ GEM
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rake (10.4.2)
|
||||
rdoc (4.2.0)
|
||||
recaptcha (0.4.0)
|
||||
responders (2.1.0)
|
||||
railties (>= 4.2.0, < 5)
|
||||
rspec-core (3.3.1)
|
||||
@@ -210,6 +211,7 @@ DEPENDENCIES
|
||||
jquery-rails
|
||||
pg
|
||||
rails (= 4.2.3)
|
||||
recaptcha
|
||||
responders
|
||||
rspec-rails (~> 3.0)
|
||||
sass-rails (~> 5.0)
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
<%= javascript_include_tag "vendor/modernizr" %>
|
||||
<%= javascript_include_tag "application", 'data-turbolinks-track' => true %>
|
||||
<%= csrf_meta_tags %>
|
||||
<script src="https://www.google.com/recaptcha/api.js?hl=<%= I18n.locale %>"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<%= render 'layouts/header' %>
|
||||
|
||||
|
||||
<% if notice %>
|
||||
<p class="alert-box success"><%= notice %></p>
|
||||
<% end %>
|
||||
@@ -22,11 +23,11 @@
|
||||
<% if alert %>
|
||||
<p class="alert-box success"><%= alert %></p>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
5
config/initializers/recaptcha.rb
Normal file
5
config/initializers/recaptcha.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Recaptcha.configure do |config|
|
||||
config.public_key = Rails.application.secrets.recaptcha_public_key
|
||||
config.private_key = Rails.application.secrets.recaptcha_public_key
|
||||
config.api_version = 'v2'
|
||||
end
|
||||
@@ -10,8 +10,18 @@
|
||||
# Make sure the secrets in this file are kept private
|
||||
# if you're sharing your code publicly.
|
||||
|
||||
default: &default
|
||||
recaptcha_public_key: <%= ENV["MARID_RECAPTCHA_PUBLIC_KEY"] %>
|
||||
recaptcha_private_key: <%= ENV["MARID_RECAPTCHA_PRIVATE_KEY"] %>
|
||||
|
||||
development:
|
||||
secret_key_base: 56792feef405a59b18ea7db57b4777e855103882b926413d4afdfb8c0ea8aa86ea6649da4e729c5f5ae324c0ab9338f789174cf48c544173bc18fdc3b14262e4
|
||||
<<: *default
|
||||
|
||||
test:
|
||||
secret_key_base: 4d5adf961ddd27aef19622d6c0b3234d555f9ee003f022b1f829c92bbe33aaee907be7feb67bd54c14a1a32512fa968565ad405971fbc41bd0797af73c26a796
|
||||
<<: *default
|
||||
|
||||
production:
|
||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||
<<: *default
|
||||
Reference in New Issue
Block a user