Skip to content

Commit e8dcae5

Browse files
authored
fix(MagicLink): Propagate context opts in request preparation (#1061)
1 parent 5aca9fc commit e8dcae5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ash_authentication/strategies/magic_link/request_preparation.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ defmodule AshAuthentication.Strategy.MagicLink.RequestPreparation do
4040
end
4141

4242
defp after_action(_query, [user], %{sender: {sender, send_opts}} = strategy, _identity, context) do
43-
case MagicLink.request_token_for(strategy, user, [], context) do
43+
context_opts = Ash.Context.to_opts(context)
44+
45+
case MagicLink.request_token_for(strategy, user, context_opts, context) do
4446
{:ok, token} -> sender.send(user, token, Keyword.put(send_opts, :tenant, context.tenant))
4547
_ -> nil
4648
end
@@ -56,7 +58,9 @@ defmodule AshAuthentication.Strategy.MagicLink.RequestPreparation do
5658
context
5759
)
5860
when not is_nil(identity) do
59-
case MagicLink.request_token_for_identity(strategy, identity, [], context) do
61+
context_opts = Ash.Context.to_opts(context)
62+
63+
case MagicLink.request_token_for_identity(strategy, identity, context_opts, context) do
6064
{:ok, token} ->
6165
sender.send(to_string(identity), token, Keyword.put(send_opts, :tenant, context.tenant))
6266

0 commit comments

Comments
 (0)