Allow the OmniAuth provider args parameter to pass through as either an Array or a Hash.

This commit is contained in:
Aaron Stone 2012-12-23 07:49:11 -08:00
parent 6a932d0af5
commit aec1a84042
2 changed files with 12 additions and 1 deletions

View file

@ -217,6 +217,15 @@ Devise.setup do |config|
end
Gitlab.config.omniauth.providers.each do |provider|
config.omniauth provider['name'].to_sym, provider['app_id'], provider['app_secret']
case provider['args']
when Array
# An Array from the configuration will be expanded.
config.omniauth provider['name'].to_sym, provider['app_id'], provider['app_secret'], *provider['args']
when Hash
# A Hash from the configuration will be passed as is.
config.omniauth provider['name'].to_sym, provider['app_id'], provider['app_secret'], provider['args']
else
config.omniauth provider['name'].to_sym, provider['app_id'], provider['app_secret']
end
end
end