Disabled login and logout for users.
This commit is contained in:
@ -32,11 +32,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<ul class="menu menu-horizontal w-full relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
<ul class="menu menu-horizontal w-full relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
||||||
<%= if @current_scope do %>
|
|
||||||
<li>
|
|
||||||
<.link href={~p"/users/log-out"} method="delete">Log out</.link>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<Layouts.theme_toggle />
|
<Layouts.theme_toggle />
|
||||||
</ul>
|
</ul>
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
|
|||||||
@ -12,81 +12,10 @@ defmodule BeetRoundServerWeb.UserLive.Login do
|
|||||||
<.header>
|
<.header>
|
||||||
<p>Log in</p>
|
<p>Log in</p>
|
||||||
<:subtitle>
|
<:subtitle>
|
||||||
<%= if @current_scope do %>
|
Bitte nutze deinen persönlichen Link der dir per Mail zugesendet wurde um dich anzumelden.
|
||||||
You need to reauthenticate to perform sensitive actions on your account.
|
|
||||||
<% else %>
|
|
||||||
Don't have an account? <.link
|
|
||||||
navigate={~p"/users/register"}
|
|
||||||
class="font-semibold text-brand hover:underline"
|
|
||||||
phx-no-format
|
|
||||||
>Sign up</.link> for an account now.
|
|
||||||
<% end %>
|
|
||||||
</:subtitle>
|
</:subtitle>
|
||||||
</.header>
|
</.header>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :if={local_mail_adapter?()} class="alert alert-info">
|
|
||||||
<.icon name="hero-information-circle" class="size-6 shrink-0" />
|
|
||||||
<div>
|
|
||||||
<p>You are running the local mail adapter.</p>
|
|
||||||
<p>
|
|
||||||
To see sent emails, visit <.link href="/dev/mailbox" class="underline">the mailbox page</.link>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<.form
|
|
||||||
:let={f}
|
|
||||||
for={@form}
|
|
||||||
id="login_form_magic"
|
|
||||||
action={~p"/users/log-in"}
|
|
||||||
phx-submit="submit_magic"
|
|
||||||
>
|
|
||||||
<.input
|
|
||||||
readonly={!!@current_scope}
|
|
||||||
field={f[:email]}
|
|
||||||
type="email"
|
|
||||||
label="Email"
|
|
||||||
autocomplete="email"
|
|
||||||
required
|
|
||||||
phx-mounted={JS.focus()}
|
|
||||||
/>
|
|
||||||
<.button class="btn btn-primary w-full">
|
|
||||||
Log in with email <span aria-hidden="true">→</span>
|
|
||||||
</.button>
|
|
||||||
</.form>
|
|
||||||
|
|
||||||
<div class="divider">or</div>
|
|
||||||
|
|
||||||
<.form
|
|
||||||
:let={f}
|
|
||||||
for={@form}
|
|
||||||
id="login_form_password"
|
|
||||||
action={~p"/users/log-in"}
|
|
||||||
phx-submit="submit_password"
|
|
||||||
phx-trigger-action={@trigger_submit}
|
|
||||||
>
|
|
||||||
<.input
|
|
||||||
readonly={!!@current_scope}
|
|
||||||
field={f[:email]}
|
|
||||||
type="email"
|
|
||||||
label="Email"
|
|
||||||
autocomplete="email"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<.input
|
|
||||||
field={@form[:password]}
|
|
||||||
type="password"
|
|
||||||
label="Password"
|
|
||||||
autocomplete="current-password"
|
|
||||||
/>
|
|
||||||
<.button class="btn btn-primary w-full" name={@form[:remember_me].name} value="true">
|
|
||||||
Log in and stay logged in <span aria-hidden="true">→</span>
|
|
||||||
</.button>
|
|
||||||
<.button class="btn btn-primary btn-soft w-full mt-2">
|
|
||||||
Log in only this time
|
|
||||||
</.button>
|
|
||||||
</.form>
|
|
||||||
</div>
|
</div>
|
||||||
</Layouts.app>
|
</Layouts.app>
|
||||||
"""
|
"""
|
||||||
@ -126,6 +55,7 @@ defmodule BeetRoundServerWeb.UserLive.Login do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp local_mail_adapter? do
|
defp local_mail_adapter? do
|
||||||
Application.get_env(:beet_round_server, BeetRoundServer.Mailer)[:adapter] == Swoosh.Adapters.Local
|
Application.get_env(:beet_round_server, BeetRoundServer.Mailer)[:adapter] ==
|
||||||
|
Swoosh.Adapters.Local
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user