fix: only pass the "token" parameter to reset with token action

This commit is contained in:
Zach Daniel 2024-07-19 10:21:06 -04:00
parent f6c2ae6267
commit 2eca4727d5
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@ defmodule AshAuthentication.Strategy.Password.Actions do
strategy.resource
|> Query.new()
|> Query.set_context(%{private: %{ash_authentication?: true}})
|> Query.for_read(strategy.sign_in_with_token_action_name, params)
|> Query.for_read(strategy.sign_in_with_token_action_name, %{"token" => params["token"]})
|> Ash.read(options)
|> case do
{:ok, [user]} ->

View file

@ -168,7 +168,7 @@ defmodule AshAuthentication.Strategy.Password.ActionsTest do
log =
capture_log(fn ->
assert :ok = Actions.reset_request(strategy, %{"username" => user.username()}, [])
assert :ok = Actions.reset_request(strategy, %{"username" => user.username}, [])
end)
assert log =~ ~r/password reset request for user #{user.username}/i