Make recaptcha optional on signup page.
This commit is contained in:
@@ -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
|
||||
|
||||
5
config/initializers/recaptcha.rb
Normal file
5
config/initializers/recaptcha.rb
Normal 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
|
||||
Reference in New Issue
Block a user