Skip to content

Commit b80e928

Browse files
author
Abdessabour Moutik
committed
impr: removed the use of select_endpoint in favor of auto-selection
1 parent ceaac89 commit b80e928

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/mix/tasks/ash_authentication_phoenix.install.ex

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,11 @@ if Code.ensure_loaded?(Igniter) do
101101
igniter,
102102
"Which Phoenix router should be modified to allow authentication?"
103103
),
104-
{:endpoint, {igniter, endpoint}}
105-
when not is_nil(endpoint) <-
106-
{:endpoint,
107-
Igniter.Libs.Phoenix.select_endpoint(
108-
igniter,
109-
router,
110-
"Which Phoenix endpoint should be used to trigger disconnects?"
111-
)} do
104+
{igniter, [endpoint | _]} <-
105+
Igniter.Libs.Phoenix.endpoints_for_router(
106+
igniter,
107+
router
108+
) do
112109
web_module = Igniter.Libs.Phoenix.web_module(igniter)
113110
overrides = Igniter.Libs.Phoenix.web_module_name(igniter, "AuthOverrides")
114111
otp_app = Igniter.Project.Application.app_name(igniter)
@@ -132,10 +129,10 @@ if Code.ensure_loaded?(Igniter) do
132129
Set up a phoenix router and reinvoke the installer with `mix igniter.install ash_authentication_phoenix`.
133130
""")
134131

135-
{:endpoint, {igniter, nil}} ->
132+
{igniter, []} ->
136133
igniter
137134
|> Igniter.add_warning("""
138-
AshAuthenticationPhoenix installer could not find a Phoenix endpoint. Skipping installation.
135+
AshAuthenticationPhoenix installer could not find any Phoenix endpoints attached to the router you selected. Skipping installation.
139136
140137
Set up a phoenix endpoint and reinvoke the installer with `mix igniter.install ash_authentication_phoenix`.
141138
""")

0 commit comments

Comments
 (0)