Skip to content

Broken Links when using forward plugΒ #417

Open
@yordis

Description

@yordis

I have the following routing setup:

defmodule Web.Router do
  use Web, :router

  forward "/admin", Web.Admin.Router
  forward "/api", Web.Api.Router
end

# .......

defmodule Web.Admin.Router do
  use Web, :router

  import Phoenix.LiveDashboard.Router
  import Oban.Web.Router

  pipeline :auth_pipe do
    plug Web.Plug.BasicAuth
  end

  pipeline :html_pipe do
    plug :fetch_session
    plug :protect_from_forgery
  end

  scope "/" do
    pipe_through [:auth_pipe]

    scope "/" do
      pipe_through [:html_pipe]

      live_dashboard "/dashboard",
        metrics: Web.Telemetry,
        ecto_repos: Application.compile_env!(:my_app, :ecto_repos)

      oban_dashboard "/oban", oban_name: Oban, as: :oban_dashboard
    end
  end
end

Environment

  • Elixir version (elixir -v): 1.14.4
  • Phoenix version (mix deps):
* absinthe_phoenix 2.0.2 (Hex package) (mix)
  locked at 2.0.2 (absinthe_phoenix) d3691892
* phoenix 1.7.2 (Hex package) (mix)
  locked at 1.7.2 (phoenix) 1ebca94b
* phoenix_ecto 4.4.1 (Hex package) (mix)
  locked at 4.4.1 (phoenix_ecto) ddccf8b4
* phoenix_html 3.3.1 (Hex package) (mix)
  locked at 3.3.1 (phoenix_html) bed1906e
* phoenix_live_dashboard 0.7.2 (Hex package) (mix)
  locked at 0.7.2 (phoenix_live_dashboard) 0e5fdf06
* phoenix_live_view 0.18.18 (Hex package) (mix)
  locked at 0.18.18 (phoenix_live_view) a5810d04
* phoenix_pubsub 2.1.1 (Hex package) (mix)
  locked at 2.1.1 (phoenix_pubsub) 81367c6d
* phoenix_template 1.0.1 (Hex package) (mix)
  locked at 1.0.1 (phoenix_template) 157dc078
* phoenix_view 2.0.2 (Hex package) (mix)
  locked at 2.0.2 (phoenix_view) a929e723

Oban

* oban_web 2.9.6 (Hex package) (mix)
  locked at 2.9.6 (oban/oban_web) be7917e9
  • Operating system: MacOS Ventura

Expected behavior

When clicking any link either in the Phoenix Dashboard or Oban Dashboard, it removes the forward section from the link:

Screen.Recording.2023-05-24.at.3.14.47.PM.mov

Actual behavior

The links and routing keeps the forward section in the URLs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions