diff --git a/config/config.exs b/config/config.exs
index c375ef2..9f7ed6e 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -9,7 +9,8 @@ import Config
config :poex,
ecto_repos: [Poex.Repo],
- generators: [timestamp_type: :utc_datetime]
+ generators: [timestamp_type: :utc_datetime],
+ open_registration: false
# Configures the endpoint
config :poex, PoexWeb.Endpoint,
diff --git a/lib/poex_web/components/layouts/root.html.heex b/lib/poex_web/components/layouts/root.html.heex
index 0ded62e..c57542a 100644
--- a/lib/poex_web/components/layouts/root.html.heex
+++ b/lib/poex_web/components/layouts/root.html.heex
@@ -13,47 +13,50 @@
-
- <%= if @current_user do %>
- -
- <%= @current_user.email %>
-
- -
- <.link
- href={~p"/users/settings"}
- class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
- >
- Settings
-
-
- -
- <.link
- href={~p"/users/log_out"}
- method="delete"
- class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
- >
- Log out
-
-
- <% else %>
- -
- <.link
- href={~p"/users/register"}
- class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
- >
- Register
-
-
- -
- <.link
- href={~p"/users/log_in"}
- class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
- >
- Log in
-
-
- <% end %>
-
+ <%= if Application.get_env(:poex, :open_registration, false) do %>
+
+
+ <%= if @current_user do %>
+ -
+ <%= @current_user.email %>
+
+ -
+ <.link
+ href={~p"/users/settings"}
+ class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
+ >
+ Settings
+
+
+ -
+ <.link
+ href={~p"/users/log_out"}
+ method="delete"
+ class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
+ >
+ Log out
+
+
+ <% else %>
+ -
+ <.link
+ href={~p"/users/register"}
+ class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
+ >
+ Register
+
+
+ -
+ <.link
+ href={~p"/users/log_in"}
+ class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
+ >
+ Log in
+
+
+ <% end %>
+
+ <% end %>
<%= @inner_content %>