|
|
|
@@ -1,9 +1,9 @@ |
|
|
|
config = Rails.application.config_for(:configuration) |
|
|
|
|
|
|
|
OmniAuth.config.add_camelization 'qq', 'QQ' if config.dig("oauth", "qq") |
|
|
|
OmniAuth.config.add_camelization 'github', 'GitHub' if config.dig("oauth", "github") |
|
|
|
OmniAuth.config.add_camelization 'gitee', 'Gitee' if config.dig("oauth", "gitee") |
|
|
|
OmniAuth.config.add_camelization 'wechat', 'Wechat' if config.dig("oauth", "wechat") |
|
|
|
# OmniAuth.config.add_camelization 'github', 'GitHub' if config.dig("oauth", "github") |
|
|
|
# OmniAuth.config.add_camelization 'gitee', 'Gitee' if config.dig("oauth", "gitee") |
|
|
|
# OmniAuth.config.add_camelization 'wechat', 'Wechat' if config.dig("oauth", "wechat") |
|
|
|
OmniAuth.config.logger = Rails.logger |
|
|
|
OmniAuth.config.before_request_phase = nil |
|
|
|
OmniAuth.config.before_callback_phase = nil |
|
|
|
@@ -22,6 +22,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do |
|
|
|
provider :gitee, config.dig("oauth", "gitee", "appid"), config.dig("oauth", "gitee", "secret"), { provider_ignores_state: true, scope: "user_info emails" } |
|
|
|
end |
|
|
|
if config.dig("oauth", "wechat").present? |
|
|
|
provider :gitee, config.dig("oauth", "wechat", "appid"), config.dig("oauth", "wechat", "secret"), { provider_ignores_state: true, scope: "snsapi_login" } |
|
|
|
provider :wechat, config.dig("oauth", "wechat", "appid"), config.dig("oauth", "wechat", "secret"), { provider_ignores_state: true, scope: "snsapi_login" } |
|
|
|
end |
|
|
|
end |