Skip to content

Commit

Permalink
test: adjust tests with new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 12, 2024
1 parent 8222e9d commit 637554b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/mix/tasks/ash_authentication_phoenix.install_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,24 @@ defmodule Mix.Tasks.AshAuthenticationPhoenix.InstallTest do
|> redirect(to: return_to)
end
def failure(conn, _activity, _reason) do
def failure(conn, activity, reason) do
message =
case {activity, reason} do
{{:magic_link, _},
%AshAuthentication.Errors.AuthenticationFailed{
caused_by: %Ash.Error.Forbidden{
errors: [%AshAuthentication.Errors.CannotConfirmUnconfirmedUser{}]
}
}} ->
\"\"\"
You have already signed in another way, but have not confirmed your account.
You can confirm your account using the link we sent to you, or by resetting your password.
\"\"\"
_ ->
"Incorrect email or password"
end
conn
|> put_flash(:error, "Incorrect email or password")
|> redirect(to: ~p"/sign-in")
Expand Down

0 comments on commit 637554b

Please sign in to comment.