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)
|
2019-06-03 07:24:12 -04:00
|
|
|
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
|