Same router scope for different pipelines. Good idea? Bad idea?

Is this a good idea or bad idea and why? Can I have two scopes with the same path?

The frontend is a Single Page App. It should support logged in and logged out users.

  scope "/api" do
    pipe_through :authenticated
    get "/dashboard", DashboardController, :index
  end

  scope "/api" do
    pipe_through([:logged_out])
    get "/signup-form-options", RegistrationController, :index
  end

I do this all the time, it works great.

1 Like