Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Remove `two_factor` feature flag (#3597)

Adrian Gruntkowski12f786810cbe
diff --git a/lib/plausible/auth/user_admin.ex b/lib/plausible/auth/user_admin.ex
index 04411a1c5a..866dd273ab 100644
--- a/lib/plausible/auth/user_admin.ex
+++ b/lib/plausible/auth/user_admin.ex
@@ -1,5 +1,6 @@
defmodule Plausible.Auth.UserAdmin do
use Plausible.Repo
+ use Plausible
require Plausible.Billing.Subscription.Status
alias Plausible.Billing.Subscription
@@ -117,9 +118,13 @@ defmodule Plausible.Auth.UserAdmin do
end
end
- defp usage_link(user) do
- path = PlausibleWeb.Router.Helpers.admin_path(PlausibleWeb.Endpoint, :usage, user.id)
- {:safe, ~s(<a href="#{path}">Usage</a>)}
+ on_full_build do
+ defp usage_link(user) do
+ path = PlausibleWeb.Router.Helpers.admin_path(PlausibleWeb.Endpoint, :usage, user.id)
+ {:safe, ~s(<a href="#{path}">Usage</a>)}
+ end
+ else
+ defp usage_link(_), do: nil
end
defp format_date(nil), do: "--"
diff --git a/lib/plausible_web/templates/auth/user_settings.html.heex b/lib/plausible_web/templates/auth/user_settings.html.heex
index a3a28fe3aa..4a6117d055 100644
--- a/lib/plausible_web/templates/auth/user_settings.html.heex
+++ b/lib/plausible_web/templates/auth/user_settings.html.heex
@@ -193,10 +193,7 @@
<% end %>
</div>
- <div
- :if={FunWithFlags.enabled?(:two_factor, for: @user)}
- class="max-w-2xl px-8 pt-6 pb-8 mx-auto mt-16 bg-white border-t-2 border-green-500 rounded rounded-t-none shadow-md dark:bg-gray-800"
- >
+ <div class="max-w-2xl px-8 pt-6 pb-8 mx-auto mt-16 bg-white border-t-2 border-green-500 rounded rounded-t-none shadow-md dark:bg-gray-800">
<h2 id="setup-2fa" class="text-xl font-black dark:text-gray-100">
Two-Factor Authentication (2FA)
</h2>
@@ -420,7 +417,6 @@
<PlausibleWeb.Components.TwoFactor.modal
:let={f}
- :if={FunWithFlags.enabled?(:two_factor, for: @user)}
id="disable-2fa-modal"
state_param="disable2FAOpen"
form_data={@conn.params}
@@ -457,7 +453,6 @@
<PlausibleWeb.Components.TwoFactor.modal
:let={f}
- :if={FunWithFlags.enabled?(:two_factor, for: @user)}
id="regenerate-2fa-modal"
state_param="regenerate2FAOpen"
form_data={@conn.params}
diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs
index b6fecb7c05..575bce4045 100644
--- a/priv/repo/seeds.exs
+++ b/priv/repo/seeds.exs
@@ -10,8 +10,6 @@
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
-FunWithFlags.enable(:two_factor)
-
user = Plausible.Factory.insert(:user, email: "[email protected]", password: "plausible")
native_stats_range =
diff --git a/test/test_helper.exs b/test/test_helper.exs
index ea8a4d0967..ed8c804287 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -3,7 +3,6 @@ Mox.defmock(Plausible.HTTPClient.Mock, for: Plausible.HTTPClient.Interface)
Application.ensure_all_started(:double)
FunWithFlags.enable(:business_tier)
FunWithFlags.enable(:window_time_on_page)
-FunWithFlags.enable(:two_factor)
Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, :manual)
if Mix.env() == :small_test do