Make recaptcha optional on signup page.

This commit is contained in:
evazion
2017-11-28 22:37:02 -06:00
parent 2000719227
commit 8d8a2f9c1e
5 changed files with 24 additions and 7 deletions

View File

@@ -619,6 +619,18 @@ module Danbooru
def aws_sqs_cropper_url
end
# Use a recaptcha on the signup page to protect against spambots creating new accounts.
# https://developers.google.com/recaptcha/intro
def enable_recaptcha?
Rails.env.production? && Danbooru.config.recaptcha_site_key.present? && Danbooru.config.recaptcha_secret_key.present?
end
def recaptcha_site_key
end
def recaptcha_secret_key
end
end
class EnvironmentConfiguration

View File

@@ -0,0 +1,5 @@
Recaptcha.configure do |config|
config.site_key = Danbooru.config.recaptcha_site_key
config.secret_key = Danbooru.config.recaptcha_secret_key
# config.proxy = "http://example.com"
end