Phx.gen.auth mixing authenticated and unauthenticated pages

Ohhhh … so the function group_index_path(@socket, :new) just throws it back to router.ex. Then the router file will redirect it to the right webpage. OK, I think I understand your solution. Thank you so much! I’ll give it a go and post the outcome.

Can I ask one more thing? Where is the function group_index_path(@socket, :new) defined? I honestly can not find Router.Helpers anywhere.

Routes is an alias defined in the web path…

in lib/my_app_web.ex

alias MyAppWeb.Router.Helpers, as: Routes

It is autogenerated.

https://hexdocs.pm/phoenix/Phoenix.Router.html#module-helpers

1 Like

I’ve read that about Helpers, but I still can’t find where those functions live. They are autogenerated supposedly into Router.ex, but my file doesn’t have any of those Helper functions in it.

My router.ex only has routes.

I am sorry, it’s very late and I think I am mixing lots of stuff about path helpers. Please consider my previous answers as wrong.

In fact, route helpers depend on Module name. They are generated from the module, not the path.

What can help is mix phx.routes to show your routing table.

Ok, I’ll check it out. Thank you again for all your help! Really appreciate it!

I posted a solution to this at this link: