diff --git a/app/views/devise/registrations/_registration_form.html.erb b/app/views/devise/registrations/_registration_form.html.erb
index 3ffd2dcb0..fd1f9f4e3 100644
--- a/app/views/devise/registrations/_registration_form.html.erb
+++ b/app/views/devise/registrations/_registration_form.html.erb
@@ -2,7 +2,7 @@
- <% if params[:state] == "new-user" && invite_only_mode? %>
+ <% if params[:state] == "new-user" && ForemInstance.private? %>
<%= community_name %> is invite only.
<% else %>
Welcome to <%= community_name %>
diff --git a/app/views/shared/authentication/_providers_registration_form.html.erb b/app/views/shared/authentication/_providers_registration_form.html.erb
index bdb99cba2..2a3404eca 100644
--- a/app/views/shared/authentication/_providers_registration_form.html.erb
+++ b/app/views/shared/authentication/_providers_registration_form.html.erb
@@ -8,7 +8,7 @@
<% end %>
<% end %>
<% end %>
- <% if params[:state] == "new-user" && Settings::Authentication.allow_email_password_registration && !Settings::Authentication.invite_only_mode %>
+ <% if params[:state] == "new-user" && Settings::Authentication.allow_email_password_registration && !ForemInstance.private? %>
<%= link_to "#{inline_svg_tag('email.svg', aria_hidden: true, class: 'crayons-icon', title: 'email')}Sign up with Email".html_safe,
request.params.merge(state: "email_signup").except("i"),
class: "crayons-btn crayons-btn--l crayons-btn--brand-email crayons-btn--icon-left whitespace-nowrap",
diff --git a/spec/helpers/authentication_helper_spec.rb b/spec/helpers/authentication_helper_spec.rb
index f2d883043..bc858a717 100644
--- a/spec/helpers/authentication_helper_spec.rb
+++ b/spec/helpers/authentication_helper_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe AuthenticationHelper, type: :helper do
describe "#authentication_provider_enabled?" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(false)
+ allow(ForemInstance).to receive(:private?).and_return(false)
allow(Settings::Authentication).to receive(:providers).and_return(%i[twitter github])
end
@@ -76,7 +76,7 @@ RSpec.describe AuthenticationHelper, type: :helper do
describe "tooltip classes, attributes and content" do
context "when invite-only-mode enabled and no enabled registration options" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(true)
+ allow(ForemInstance).to receive(:private?).and_return(true)
allow(Settings::Authentication).to receive(:providers).and_return([])
allow(Settings::Authentication).to receive(:allow_email_password_registration).and_return(false)
end
diff --git a/spec/system/authentication/creator_config_edit_spec.rb b/spec/system/authentication/creator_config_edit_spec.rb
index b16856ade..2f948dd9d 100644
--- a/spec/system/authentication/creator_config_edit_spec.rb
+++ b/spec/system/authentication/creator_config_edit_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe "Creator config edit", type: :system, js: true do
context "when a creator browses /admin/customization/config" do
before do
sign_in admin
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(false)
+ allow(ForemInstance).to receive(:private?).and_return(false)
end
it "presents all available OAuth providers" do
diff --git a/spec/system/authentication/user_logs_in_with_email_spec.rb b/spec/system/authentication/user_logs_in_with_email_spec.rb
index cbdca524a..29d952e88 100644
--- a/spec/system/authentication/user_logs_in_with_email_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_email_spec.rb
@@ -116,7 +116,7 @@ RSpec.describe "Authenticating with Email" do
context "when community is in invite only mode" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(true)
+ allow(ForemInstance).to receive(:private?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_facebook_spec.rb b/spec/system/authentication/user_logs_in_with_facebook_spec.rb
index 473cbece2..15615f842 100644
--- a/spec/system/authentication/user_logs_in_with_facebook_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_facebook_spec.rb
@@ -234,7 +234,7 @@ RSpec.describe "Authenticating with Facebook" do
context "when community is in invite only mode" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(true)
+ allow(ForemInstance).to receive(:private?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_github_spec.rb b/spec/system/authentication/user_logs_in_with_github_spec.rb
index c6e1c12ad..407390cbc 100644
--- a/spec/system/authentication/user_logs_in_with_github_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_github_spec.rb
@@ -200,7 +200,7 @@ RSpec.describe "Authenticating with GitHub" do
context "when community is in invite only mode" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(true)
+ allow(ForemInstance).to receive(:private?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_twitter_spec.rb b/spec/system/authentication/user_logs_in_with_twitter_spec.rb
index 1589eeed0..63d842152 100644
--- a/spec/system/authentication/user_logs_in_with_twitter_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_twitter_spec.rb
@@ -192,7 +192,7 @@ RSpec.describe "Authenticating with Twitter" do
context "when community is in invite only mode" do
before do
- allow(Settings::Authentication).to receive(:invite_only_mode).and_return(true)
+ allow(ForemInstance).to receive(:private?).and_return(true)
end
it "doesn't present the authentication option" do