discourse-steam-login/lib/auth/steam_authenticator.rb

19 lines
392 B
Ruby
Raw Normal View History

2019-07-29 21:31:07 -04:00
# frozen_string_literal: true
2019-05-10 03:48:41 -04:00
class Auth::SteamAuthenticator < ::Auth::ManagedAuthenticator
def name
'steam'
end
def enabled?
SiteSetting.enable_steam_logins
end
def register_middleware(omniauth)
omniauth.provider :steam, setup: lambda { |env|
strategy = env["omniauth.strategy"]
strategy.options[:api_key] = SiteSetting.steam_web_api_key
}
2019-05-10 03:48:41 -04:00
end
end