By default when using pow_routes() the paths for all routes are generated such as:
/session/new
/registration/new
I'd like to be able to have my route paths defined as:
/sign_up
/sign_in
Is there currently a way to do this?
I think you can find an example for custom routes here: https://github.com/danschultzer/pow/blob/master/guides/custom_controllers.md
They can be overridden, the same way you would override routes normally in Phoenix:
defmodule MyAppWeb.Router do
use MyAppWeb, :router
use Pow.Phoenix.Router
# ...
scope "/", Pow.Phoenix, as: "pow" do
get "/sign_up", RegistrationController, :new
post "/sign_up", RegistrationController, :create
get "/sign_in", SessionController, :new
post "/sign_in", SessionController, :create
end
scope "/" do
pow_routes()
end
# ...
end
thanks @danschultzer that is exactly what I was looking for.
Most helpful comment
They can be overridden, the same way you would override routes normally in Phoenix: