Skip to content

Commit

Permalink
Add recaptcha api js for internal
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindkushwah9 committed Nov 7, 2020
1 parent b5be96e commit f26278e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@
//= require browser
//= require topbar

// --- Recaptcha
//= require recaptcha/api
$(function(){ $(document).foundation(); });
1 change: 1 addition & 0 deletions app/assets/javascripts/recaptcha/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
label: t('simple_form.labels.user.accept_terms_of_use').html_safe
.row
.medium-12.columns
/ = recaptcha_tags
.g-recaptcha{"data-sitekey" => "6LfpkN4ZAAAAAHkHFAbtd1p6uNkK7mISiVfx1YDh"}
= recaptcha_tags
/ .g-recaptcha{"data-sitekey" => "#{Settings.recaptcha.site_key}"}
/ .g-recaptcha{"data-callback" => "recaptchaCallback", "data-sitekey" => "6Lctit4ZAAAAAErhRLHN95FO7WoyOjTrhJd8_0sc"}
.row
.medium-12.columns.medium-text-left
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/_head.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
%link{ href: "/images/apple-touch-icon.png", rel: "apple-touch-icon" }/
%link{ href: "/images/apple-touch-icon-72x72.png", rel: "apple-touch-icon", sizes: "72x72" }/
%link{ href: "/images/apple-touch-icon-114x114.png", rel: "apple-touch-icon", sizes: "114x114" }/
%script{:src => "https://www.google.com/recaptcha/api.js"}
-# WEBFONTS
- if Rails.env.production?
Expand Down
8 changes: 4 additions & 4 deletions config/initializers/recaptcha.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Recaptcha.configure do |config|
config.site_key = '6LfKJt4ZAAAAAKmwBpl9NLj5xTCjnvPBnmmmRI61'
config.secret_key = '6LfKJt4ZAAAAAJDRUvE8j0O7NGNeHjk-jAVFwS9K'
end
# Recaptcha.configure do |config|
# config.site_key = Settings.recaptcha.site_key
# config.secret_key = Settings.recaptcha.secret_key
# end
7 changes: 7 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,10 @@ devices:
# user: device
aws_access_key_id: should be overridden via settings.local.yml
aws_secret_access_key: should be overridden via settings.local.yml

# recapcha:
# site_key: 6LfpkN4ZAAAAAHkHFAbtd1p6uNkK7mISiVfx1YDh

recaptcha:
site_key: 6LfKJt4ZAAAAAKmwBpl9NLj5xTCjnvPBnmmmRI61
secret_key: 6LfKJt4ZAAAAAJDRUvE8j0O7NGNeHjk-jAVFwS9K

This comment has been minimized.

Copy link
@iamareebjamal

iamareebjamal Nov 30, 2020

As all keys above, should not be hardcoded and overriden in settings.local.yml

0 comments on commit f26278e

Please sign in to comment.