Skip to content

Commit

Permalink
chore: Tweak UI styling (#530)
Browse files Browse the repository at this point in the history
* chore: Separate MagicLink form out to a new section on the bottom of the page

* chore: Allow the submit label on the Password Reset form to be formatted a bit more nicely
  • Loading branch information
sevenseacat authored Nov 14, 2024
1 parent 394041a commit cdfea54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions lib/ash_authentication_phoenix/components/password/input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ defmodule AshAuthentication.Phoenix.Components.Password.Input do
|> assign_new(:overrides, fn -> [AshAuthentication.Phoenix.Overrides.Default] end)
|> assign_new(:label, fn ->
case assigns.action do
:reset ->
assigns.strategy.resettable
|> Kernel.||(%{})
|> Map.get(:password_reset_action_name, :reset)
|> to_string()
|> String.trim_trailing("_with_password")

:request_reset ->
assigns.strategy.resettable
|> Kernel.||(%{})
Expand Down
1 change: 0 additions & 1 deletion lib/ash_authentication_phoenix/components/reset/form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ defmodule AshAuthentication.Phoenix.Components.Reset.Form do
form={form}
action={:reset}
disable_text={override_for(@overrides, :disable_button_text)}
label={humanize(@resettable.password_reset_action_name)}
overrides={@overrides}
/>
</.form>
Expand Down
2 changes: 1 addition & 1 deletion lib/ash_authentication_phoenix/components/sign_in.ex
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ defmodule AshAuthentication.Phoenix.Components.SignIn do

defp strategy_style(%AshAuthentication.AddOn.Confirmation{}), do: nil
defp strategy_style(%Strategy.Password{}), do: :form
defp strategy_style(%Strategy.MagicLink{}), do: :form
defp strategy_style(%Strategy.MagicLink{}), do: :link
defp strategy_style(_), do: :link

defp component_for_strategy(%{strategy_module: Strategy.Apple}), do: Components.Apple
Expand Down

0 comments on commit cdfea54

Please sign in to comment.