diff --git a/lib/mix/tasks/ash_authentication.install.ex b/lib/mix/tasks/ash_authentication.install.ex index b15daf34..7412a19c 100644 --- a/lib/mix/tasks/ash_authentication.install.ex +++ b/lib/mix/tasks/ash_authentication.install.ex @@ -216,6 +216,11 @@ defmodule Mix.Tasks.AshAuthentication.Install do [:authentication, :tokens, :signing_secret], secrets_module ) + |> Spark.Igniter.set_option( + user_resource, + [:authentication, :tokens, :store_all_tokens?], + true + ) |> Igniter.Project.Config.configure_new( "dev.exs", otp_app, diff --git a/test/mix/tasks/ash_authentication.add_strategy_test.exs b/test/mix/tasks/ash_authentication.add_strategy_test.exs index ca3d8629..dcfda433 100644 --- a/test/mix/tasks/ash_authentication.add_strategy_test.exs +++ b/test/mix/tasks/ash_authentication.add_strategy_test.exs @@ -22,15 +22,15 @@ defmodule Mix.Tasks.AshAuthentication.AddStrategyTest do igniter |> Igniter.compose_task("ash_authentication.add_strategy", ["password"]) |> assert_has_patch("lib/test/accounts/user.ex", """ - 26 + | strategies do - 27 + | password :password do - 28 + | identity_field(:email) - 29 + | - 30 + | resettable do - 31 + | sender(Test.Accounts.User.Senders.SendPasswordResetEmail) - 32 + | end - 33 + | end - 34 + | end + + | strategies do + + | password :password do + + | identity_field(:email) + + | + + | resettable do + + | sender(Test.Accounts.User.Senders.SendPasswordResetEmail) + + | end + + | end + + | end """) end diff --git a/test/mix/tasks/ash_authentication.install_test.exs b/test/mix/tasks/ash_authentication.install_test.exs index 20e63789..06d540ee 100644 --- a/test/mix/tasks/ash_authentication.install_test.exs +++ b/test/mix/tasks/ash_authentication.install_test.exs @@ -86,6 +86,7 @@ defmodule Mix.Tasks.AshAuthentication.InstallTest do enabled?(true) token_resource(Test.Accounts.Token) signing_secret(Test.Secrets) + store_all_tokens?(true) end end