ApiManagementConsoleV2Web.Plugs.RequireAdmin (api_management_console v0.1.2)

Copy Markdown View Source

Ensures the user is authenticated before accessing console routes.

Checks Plug.Conn.get_session/2 for :api_console_user. If not authenticated, redirects to the login page. If authenticated, assigns :api_console_user to the conn for downstream use.

Session key

:api_console_user  %{username: "john", role: :admin}