diff --git a/app/views/admin/settings/forms/_authentication.html.erb b/app/views/admin/settings/forms/_authentication.html.erb index 073ac74bf..3d8332173 100644 --- a/app/views/admin/settings/forms/_authentication.html.erb +++ b/app/views/admin/settings/forms/_authentication.html.erb @@ -159,7 +159,6 @@ readonly: true %> <% authentication_available_providers.each do |provider| %> - <% next if provider.provider_name == :apple && !Flipper.enabled?(:apple_auth) %>
<%= inline_svg_tag("#{provider.provider_name}.svg", class: "crayons-icon", aria: true, title: "#{provider.official_name} logo") %> diff --git a/app/views/shared/authentication/_providers_registration_form.html.erb b/app/views/shared/authentication/_providers_registration_form.html.erb index 9d01a77bd..982bb0282 100644 --- a/app/views/shared/authentication/_providers_registration_form.html.erb +++ b/app/views/shared/authentication/_providers_registration_form.html.erb @@ -1,7 +1,6 @@
<% authentication_enabled_providers.each do |provider| %> <% next unless display_social_login? %> - <% next if provider.provider_name == :apple && !FeatureFlag.enabled?(:apple_auth) %> <%= form_with url: provider.sign_in_path(state: "navbar_basic"), class: "flex w-100", local: true do |f| %> <%= f.button type: :submit, class: "crayons-btn crayons-btn--l crayons-btn--brand-#{provider.provider_name} crayons-btn--icon-left grow-1 whitespace-nowrap" do %> <%= inline_svg_tag("#{provider.provider_name}.svg", aria_hidden: true, class: "crayons-icon", title: provider.provider_name) %> diff --git a/app/views/users/_additional_authentication.html.erb b/app/views/users/_additional_authentication.html.erb index 2cf1a00f9..423c9e6f8 100644 --- a/app/views/users/_additional_authentication.html.erb +++ b/app/views/users/_additional_authentication.html.erb @@ -2,10 +2,9 @@
<% authentication_enabled_providers.each do |provider| %> <% next if provider.provider_name == :apple %> <% unless @user.authenticated_through?(provider.provider_name) %> diff --git a/docs/backend/auth-apple.md b/docs/backend/auth-apple.md index afc84a62b..f292675ae 100644 --- a/docs/backend/auth-apple.md +++ b/docs/backend/auth-apple.md @@ -1,5 +1,5 @@ --- -title: Apple Authentication (beta) +title: Apple Authentication --- # Sign in with Apple Authentication @@ -12,15 +12,6 @@ retrieve the necessary credentials and an HTTPS supported URL for the callback configuration (HTTP won't work). Then you'll need to provide the keys to the Rails application. -#### Beta support - -This authentication provider is currently marked as beta. This means it will be -available but hidden from public access until more thoroughly tested. - -If you want to make this feature publicly available (without the state -parameter) you can enable the `apple_auth` feature flag from the Flipper -dashboard or the Rails console with `Flipper.enable(:apple_auth)`. - # Apple Developer Portal Configuration [Register/Sign in](https://developer.apple.com/account) to your Apple Developer diff --git a/lib/data_update_scripts/20210803161945_remove_apple_auth_feature_flag.rb b/lib/data_update_scripts/20210803161945_remove_apple_auth_feature_flag.rb new file mode 100644 index 000000000..d4ed69f2d --- /dev/null +++ b/lib/data_update_scripts/20210803161945_remove_apple_auth_feature_flag.rb @@ -0,0 +1,7 @@ +module DataUpdateScripts + class RemoveAppleAuthFeatureFlag + def run + FeatureFlag.remove(:apple_auth) + end + end +end diff --git a/spec/lib/data_update_scripts/remove_apple_auth_feature_flag_spec.rb b/spec/lib/data_update_scripts/remove_apple_auth_feature_flag_spec.rb new file mode 100644 index 000000000..1172d0227 --- /dev/null +++ b/spec/lib/data_update_scripts/remove_apple_auth_feature_flag_spec.rb @@ -0,0 +1,20 @@ +require "rails_helper" +require Rails.root.join( + "lib/data_update_scripts/20210803161945_remove_apple_auth_feature_flag.rb", +) + +describe DataUpdateScripts::RemoveAppleAuthFeatureFlag do + it "removes the :apple_auth flag" do + FeatureFlag.enable(:apple_auth) + + described_class.new.run + + expect(FeatureFlag.exist?(:apple_auth)).to be(false) + end + + it "works if the flag is not available" do + described_class.new.run + + expect(FeatureFlag.exist?(:apple_auth)).to be(false) + end +end diff --git a/spec/requests/registrations_spec.rb b/spec/requests/registrations_spec.rb index 04f311f98..bf420935a 100644 --- a/spec/requests/registrations_spec.rb +++ b/spec/requests/registrations_spec.rb @@ -10,7 +10,6 @@ RSpec.describe "Registrations", type: :request do Authentication::Providers.enabled.each do |provider_name| provider = Authentication::Providers.get!(provider_name) - next if provider.provider_name == :apple && !Flipper.enabled?(:apple_auth) expect(response.body).to include("Continue with #{provider.official_name}") end diff --git a/spec/requests/user/user_settings_spec.rb b/spec/requests/user/user_settings_spec.rb index 83d97f4c6..f3c608764 100644 --- a/spec/requests/user/user_settings_spec.rb +++ b/spec/requests/user/user_settings_spec.rb @@ -180,6 +180,17 @@ RSpec.describe "UserSettings", type: :request do expect(response.body).to include("Connect GitHub Account") end + + it "does not allow to connect an Apple Account to an existing user" do + allow(Authentication::Providers).to receive(:enabled).and_return(Authentication::Providers.available) + user = create(:user, :with_identity, identities: [:twitter]) + + sign_in user + get user_settings_path + + expect(response.body).to include("Connect GitHub Account") + expect(response.body).not_to include("Connect Apple Account") + end end describe "GitHub repositories" do diff --git a/spec/system/authentication/beta_access_providers_spec.rb b/spec/system/authentication/beta_access_providers_spec.rb deleted file mode 100644 index c24e2b1b0..000000000 --- a/spec/system/authentication/beta_access_providers_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require "rails_helper" - -RSpec.describe "Beta provider access", type: :system do - let(:providers) { %w[Facebook GitHub Twitter] } - let(:beta_providers) { ["Apple"] } - - before do - allow(Settings::Authentication).to receive(:providers).and_return(Authentication::Providers.available) - end - - context "when a user tries to sign_up" do - it "doesn't render beta providers by default" do - visit sign_up_path - - providers.each do |name| - expect(page).to have_button("Continue with #{name}") - end - - beta_providers.each do |name| - expect(page).not_to have_button("Continue with #{name}") - end - end - - it "renders beta providers when passed in the correct state param" do - Flipper.enable(:apple_auth) - visit sign_up_path - - providers.each do |name| - expect(page).to have_button("Continue with #{name}") - end - - beta_providers.each do |name| - expect(page).to have_button("Continue with #{name}") - end - end - end -end diff --git a/spec/system/authentication/conditional_registration_spec.rb b/spec/system/authentication/conditional_registration_spec.rb index e09fc99ad..71fa3780e 100644 --- a/spec/system/authentication/conditional_registration_spec.rb +++ b/spec/system/authentication/conditional_registration_spec.rb @@ -16,7 +16,6 @@ RSpec.describe "Conditional registration (ForemWebView)", type: :system do end before do - allow(FeatureFlag).to receive(:enabled?).with(:apple_auth).and_return(true) allow(FeatureFlag).to receive(:enabled?).with(:creator_onboarding).and_return(false) allow(Settings::Authentication).to receive(:allow_email_password_registration).and_return(true) end diff --git a/spec/system/authentication/creator_config_edit_spec.rb b/spec/system/authentication/creator_config_edit_spec.rb index 2f948dd9d..10cfbda49 100644 --- a/spec/system/authentication/creator_config_edit_spec.rb +++ b/spec/system/authentication/creator_config_edit_spec.rb @@ -3,9 +3,6 @@ require "rails_helper" RSpec.describe "Creator config edit", type: :system, js: true do let(:admin) { create(:user, :super_admin) } - # Apple auth is in Beta so we need to enable the Feature Flag to test it - before { Flipper.enable(:apple_auth) } - context "when a creator browses /admin/customization/config" do before do sign_in admin diff --git a/spec/system/authentication/omniauth_redirect_uri_spec.rb b/spec/system/authentication/omniauth_redirect_uri_spec.rb index 1d5385847..444d0ce4b 100644 --- a/spec/system/authentication/omniauth_redirect_uri_spec.rb +++ b/spec/system/authentication/omniauth_redirect_uri_spec.rb @@ -6,9 +6,6 @@ RSpec.describe "Omniauth redirect_uri", type: :system do # Avoid messing with other tests by resetting back Settings::General.app_domain after { Settings::General.app_domain = test_app_domain } - # Apple auth is in Beta so we need to enable the Feature Flag to test it - before { Flipper.enable(:apple_auth) } - def provider_redirect_regex(provider_name) # URL encoding translates the query params (i.e. colons/slashes/etc) %r{ diff --git a/spec/system/authentication/user_logs_in_with_apple_spec.rb b/spec/system/authentication/user_logs_in_with_apple_spec.rb index bec41bb2b..11fb7c3e6 100644 --- a/spec/system/authentication/user_logs_in_with_apple_spec.rb +++ b/spec/system/authentication/user_logs_in_with_apple_spec.rb @@ -5,7 +5,6 @@ RSpec.describe "Authenticating with Apple", vcr: { cassette_name: "fastly_sloan" before do omniauth_mock_apple_payload - Flipper.enable(:apple_auth) allow(Settings::Authentication).to receive(:providers).and_return(Authentication::Providers.available) end diff --git a/spec/system/link_for_tags_in_posts_in_notifications_spec.rb b/spec/system/link_for_tags_in_posts_in_notifications_spec.rb index 8df848f63..6c82c5479 100644 --- a/spec/system/link_for_tags_in_posts_in_notifications_spec.rb +++ b/spec/system/link_for_tags_in_posts_in_notifications_spec.rb @@ -16,7 +16,6 @@ RSpec.describe "Link on tags for post in notifications", type: :system do it "shows the sign-with page", js: true do Authentication::Providers.enabled.each do |provider_name| provider = Authentication::Providers.get!(provider_name) - next if provider.provider_name == :apple && !Flipper.enabled?(:apple_auth) expect(page).to have_content("Continue with #{provider.official_name}") end