FIX: Access API key site setting at runtime

Accessing site settings on boot meant changes were not reflected until the server was restarted, and the plugin was not multi-site compatible. This commit uses the same convention used in other auth providers to access the site setting during the web request.
This commit is contained in:
David Taylor 2019-06-03 12:24:12 +01:00
parent 50d64381ed
commit de60de90c2
1 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,9 @@ class Auth::SteamAuthenticator < ::Auth::ManagedAuthenticator
end
def register_middleware(omniauth)
omniauth.provider :steam, SiteSetting.steam_web_api_key
omniauth.provider :steam, setup: lambda { |env|
strategy = env["omniauth.strategy"]
strategy.options[:api_key] = SiteSetting.steam_web_api_key
}
end
end