FIX: returns provider_not_enabled error even if enabled

This commit is contained in:
Vinoth Kannan 2018-07-13 22:49:30 +05:30
parent b459a589ab
commit 06deffc9da
1 changed files with 3 additions and 1 deletions

View File

@ -99,10 +99,12 @@ class Users::OmniauthCallbacksController < ApplicationController
end
Discourse.auth_providers.each do |provider|
next if provider.name != name
unless provider.enabled_setting.nil? || SiteSetting.send(provider.enabled_setting)
raise Discourse::InvalidAccess.new(I18n.t("provider_not_enabled"))
end
return provider.authenticator if provider.name == name
return provider.authenticator
end
raise Discourse::InvalidAccess.new(I18n.t("provider_not_found"))