From 15087abff724e37721234d74b89d0c6015a5c77a Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Wed, 5 Nov 2014 14:56:08 +0000 Subject: [PATCH] do not use self.class.config directly --- lib/omniauth/openid_connect/provider.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/omniauth/openid_connect/provider.rb b/lib/omniauth/openid_connect/provider.rb index c62740de04..0e30baf13d 100644 --- a/lib/omniauth/openid_connect/provider.rb +++ b/lib/omniauth/openid_connect/provider.rb @@ -108,11 +108,11 @@ module OmniAuth { :name => name, :scope => [:openid, :email, :profile], - :icon => self.class.config["icon"], - :display_name => self.class.config["display_name"], + :icon => config["icon"], + :display_name => config["display_name"], :client_options => client_options.merge( # override with configuration Hash[ - self.class.config.reject do |key, value| + config.reject do |key, value| ["identifier", "secret", "icon", "display_name"].include? key end.map do |key, value| [key.to_sym, value] @@ -145,7 +145,9 @@ module OmniAuth config("secret") end - def config(key) + def config(key = nil) + return self.class.config unless key + self.class.config[key] || error_configure(key) end