Provides the multi_account_routes/3 macro for generating multi-account routes.
Usage
defmodule MyAppWeb.Router do
use Phoenix.Router
use AshMultiAccount.Phoenix.Router
scope "/", MyAppWeb do
pipe_through :browser
multi_account_routes MultiAccountController, MyApp.Accounts.User
end
endThis generates:
get "/link/p/:primary_user_id", MultiAccountController, :link_account
post "/link/p/:primary_user_id", MultiAccountController, :link_account
get "/link/switch_to/:user_id", MultiAccountController, :switch_to_accountCustom Paths
multi_account_routes MyController, MyUser,
link_path: "/accounts/link/:primary_user_id",
switch_path: "/accounts/switch/:user_id"
Summary
Functions
Generates routes for multi-account link and switch actions.