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:
David Taylor
2019-10-08 12:10:43 +01:00
committed by GitHub
parent 20514f2e44
commit d2bceff133
21 changed files with 92 additions and 271 deletions

View File

@@ -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