Sign-in: custom SignInLive, OIDC-only mode and hide OIDC when not configured, locale divider or/oder

This commit is contained in:
Moritz 2026-02-24 15:07:45 +01:00
parent 3f73a36076
commit 2cab4b0de4
Signed by: moritz
GPG key ID: 1020A035E5DD0824
4 changed files with 145 additions and 8 deletions

View file

@ -112,7 +112,8 @@ defmodule MvWeb.Router do
auth_routes_prefix: "/auth",
on_mount: [{MvWeb.LiveUserAuth, :live_no_user}],
overrides: [MvWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.DaisyUI],
gettext_backend: {MvWeb.Gettext, "auth"}
gettext_backend: {MvWeb.Gettext, "auth"},
live_view: MvWeb.SignInLive
# Remove this if you do not want to use the reset password feature
reset_route auth_routes_prefix: "/auth",
@ -212,8 +213,8 @@ defmodule MvWeb.Router do
end)
end
# Our supported languages for now are german and english, english as fallback language
# Our supported languages: German and English; default German.
defp supported_locale?(locale), do: locale in ["en", "de"]
defp fallback_locale(nil), do: "en"
defp fallback_locale(nil), do: Application.get_env(:mv, :default_locale, "de")
defp fallback_locale(locale), do: locale
end