From 2eca4727d5a096c90503c2262ea43f09ba48b426 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Fri, 19 Jul 2024 10:21:06 -0400 Subject: [PATCH] fix: only pass the "token" parameter to reset with token action --- lib/ash_authentication/strategies/password/actions.ex | 2 +- test/ash_authentication/strategies/password/actions_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ash_authentication/strategies/password/actions.ex b/lib/ash_authentication/strategies/password/actions.ex index ce67ba19..7ff17f2b 100644 --- a/lib/ash_authentication/strategies/password/actions.ex +++ b/lib/ash_authentication/strategies/password/actions.ex @@ -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]} -> diff --git a/test/ash_authentication/strategies/password/actions_test.exs b/test/ash_authentication/strategies/password/actions_test.exs index 5f6206e4..e03a3e55 100644 --- a/test/ash_authentication/strategies/password/actions_test.exs +++ b/test/ash_authentication/strategies/password/actions_test.exs @@ -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