Stop relying on app env for self hosted registration

pull/3559/head
Adam Rutkowski 3 years ago
parent a45891441d
commit dde84df609

@ -31,12 +31,6 @@ defmodule PlausibleWeb.AuthController do
]
)
plug(:assign_is_selfhost)
defp assign_is_selfhost(conn, _opts) do
assign(conn, :is_selfhost, Plausible.Release.selfhost?())
end
def register(conn, %{"user" => %{"email" => email, "password" => password}}) do
with {:ok, user} <- login_user(conn, email, password) do
conn = set_user_session(conn, user)

@ -5,6 +5,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
use Phoenix.LiveView
use Phoenix.HTML
use Plausible
import PlausibleWeb.Live.Components.Form
@ -37,7 +38,6 @@ defmodule PlausibleWeb.Live.RegisterForm do
form: to_form(changeset),
captcha_error: nil,
password_strength: Auth.User.password_strength(changeset),
is_selfhost: Plausible.Release.selfhost?(),
trigger_submit: false
)}
end
@ -68,7 +68,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
~H"""
<div class="mx-auto mt-6 text-center dark:text-gray-300">
<h1 class="text-3xl font-black">
<%= if @is_selfhost or @live_action == :register_from_invitation_form do %>
<%= if not full_build?() or @live_action == :register_from_invitation_form do %>
Register your Plausible Analytics account
<% else %>
Register your 30-day free trial
@ -162,7 +162,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
<% end %>
<% submit_text =
if @is_selfhost or @invitation do
if not full_build?() or @invitation do
"Create my account →"
else
"Start my free trial →"

Loading…
Cancel
Save