Skip to content

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

630 B
Raw Blame
<.focus_box>
  <:title>Enter password</:title>
  <:subtitle>
    This link is password-protected. Please enter the password to continue to the dashboard.
  </:subtitle>
  <.form
    :let={f}
    for={@conn}
    action={~p"/share/#{@link.slug}/authenticate" <> "?#{@query_string}"}
    method="post"
  >
    <div class="my-6">
      <.input type="password" field={f[:password]} />

      <%= if @conn.assigns[:error] do %>
        <div class="text-red-500 text-xs mt-1">{@conn.assigns[:error]}</div>
      <% end %>
    </div>

    <.button type="submit" class="w-full mt-6">
      Continue
    </.button>
  </.form>
</.focus_box>