defmodule MvWeb.SignOutLive do @moduledoc """ Custom sign-out confirmation page. Replaces AshAuthentication.Phoenix.SignOutLive so the page meets accessibility requirements (main landmark via Layouts.public_page, level-one heading) and uses the project's DaisyUI button styles. Submits DELETE /sign-out for CSRF protection, same contract as the library default. """ use Phoenix.LiveView use Gettext, backend: MvWeb.Gettext alias Mv.Membership alias MvWeb.Layouts @impl true def mount(_params, session, socket) do locale = session["locale"] || Application.get_env(:mv, :default_locale, "de") Gettext.put_locale(MvWeb.Gettext, locale) Gettext.put_locale(locale) club_name = case Membership.get_settings() do {:ok, settings} when is_binary(settings.club_name) -> settings.club_name _ -> nil end socket = socket |> assign(:sign_out_path, session["sign_out_path"] || "/sign-out") |> assign(:locale, locale) |> assign(:club_name, club_name) |> Layouts.assign_page_title(dgettext("auth", "Sign out")) {:ok, socket} end @impl true def render(assigns) do ~H"""

{dgettext("auth", "Sign out")}

{dgettext("auth", "Are you sure you want to sign out?")}

<.form for={%{}} action={@sign_out_path} method="delete">
""" end end