mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Use full page redirection for all external auth methods (#8092)
Using popups is becoming increasingly rare. Full page redirects are already used on mobile, and for some providers. This commit removes all logic related to popup authentication, leaving only the full page redirect method. For more info, see https://meta.discourse.org/t/do-we-need-popups-for-login/127988
This commit is contained in:
@@ -161,20 +161,26 @@ describe Plugin::Instance do
|
||||
end
|
||||
|
||||
it 'patches the enabled? function for auth_providers if not defined' do
|
||||
SimpleAuthenticator = Class.new(Auth::Authenticator) do
|
||||
def name
|
||||
"my_authenticator"
|
||||
end
|
||||
end
|
||||
|
||||
plugin = Plugin::Instance.new
|
||||
|
||||
# lets piggy back on another boolean setting, so we don't dirty our SiteSetting object
|
||||
SiteSetting.enable_badges = false
|
||||
|
||||
# No enabled_site_setting
|
||||
authenticator = Auth::Authenticator.new
|
||||
authenticator = SimpleAuthenticator.new
|
||||
plugin.auth_provider(authenticator: authenticator)
|
||||
plugin.notify_before_auth
|
||||
expect(authenticator.enabled?).to eq(true)
|
||||
|
||||
# With enabled site setting
|
||||
plugin = Plugin::Instance.new
|
||||
authenticator = Auth::Authenticator.new
|
||||
authenticator = SimpleAuthenticator.new
|
||||
plugin.auth_provider(enabled_setting: 'enable_badges', authenticator: authenticator)
|
||||
plugin.notify_before_auth
|
||||
expect(authenticator.enabled?).to eq(false)
|
||||
@@ -183,7 +189,7 @@ describe Plugin::Instance do
|
||||
plugin = Plugin::Instance.new
|
||||
|
||||
SiteSetting.enable_badges = true
|
||||
authenticator = Class.new(Auth::Authenticator) do
|
||||
authenticator = Class.new(SimpleAuthenticator) do
|
||||
def enabled?
|
||||
false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user