mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 02:24:03 -05:00
Move hcaptcha service config to config_for
yml (#30662)
This commit is contained in:
parent
35f008aa2a
commit
97b18d10b4
@ -10,7 +10,7 @@ module Auth::CaptchaConcern
|
|||||||
end
|
end
|
||||||
|
|
||||||
def captcha_available?
|
def captcha_available?
|
||||||
ENV['HCAPTCHA_SECRET_KEY'].present? && ENV['HCAPTCHA_SITE_KEY'].present?
|
Rails.configuration.x.captcha.secret_key.present? && Rails.configuration.x.captcha.site_key.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def captcha_enabled?
|
def captcha_enabled?
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
module Admin::SettingsHelper
|
module Admin::SettingsHelper
|
||||||
def captcha_available?
|
def captcha_available?
|
||||||
ENV['HCAPTCHA_SECRET_KEY'].present? && ENV['HCAPTCHA_SITE_KEY'].present?
|
Rails.configuration.x.captcha.secret_key.present? && Rails.configuration.x.captcha.site_key.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_activity_title(activity)
|
def login_activity_title(activity)
|
||||||
|
@ -109,6 +109,7 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.x.captcha = config_for(:captcha)
|
||||||
config.x.translation = config_for(:translation)
|
config.x.translation = config_for(:translation)
|
||||||
|
|
||||||
config.to_prepare do
|
config.to_prepare do
|
||||||
|
3
config/captcha.yml
Normal file
3
config/captcha.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
shared:
|
||||||
|
secret_key: <%= ENV.fetch('HCAPTCHA_SECRET_KEY', nil) %>
|
||||||
|
site_key: <%= ENV.fetch('HCAPTCHA_SITE_KEY', nil) %>
|
Loading…
Reference in New Issue
Block a user