Skip to content

Commit

Permalink
improvement: use better action name for password reset
Browse files Browse the repository at this point in the history
This should become the default name in 5.0
  • Loading branch information
zachdaniel committed Dec 23, 2024
1 parent 96b9db2 commit a352244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/ash_authentication/strategies/password/transformer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ defmodule AshAuthentication.Strategy.Password.Transformer do
maybe_set_field_lazy(
resettable,
:password_reset_action_name,
# Change this default in 5.0
fn _ -> :"password_reset_with_#{strategy.name}" end
),
{:ok, dsl_state} <-
Expand Down
4 changes: 3 additions & 1 deletion lib/mix/tasks/ash_authentication.add_strategy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ if Code.ensure_loaded?(Igniter) do
resettable do
sender #{inspect(sender)}
# this configuration will be the default in a future release
passsword_reset_action_name :reset_password_with_token
end
end
""")
Expand Down Expand Up @@ -285,7 +287,7 @@ if Code.ensure_loaded?(Igniter) do
)
|> ensure_get_by_action(options)
|> Ash.Resource.Igniter.add_new_action(options[:user], :password_reset_with_password, """
update :password_reset_with_password do
update :reset_password_with_token do
argument :reset_token, :string do
allow_nil? false
sensitive? true
Expand Down

0 comments on commit a352244

Please sign in to comment.