litellm/ui/litellm-dashboard
ryan-crabbe-berri 3ece94bb7a refactor(ui): single auth engine; useAuthorized becomes a policy layer over AuthContext
The dashboard had two parallel auth systems: AuthContext (provided at the
root, used by the legacy ?page= shell) and useAuthorized (used by ~85 files
in the migrated tree), each reading the cookie, decoding the JWT, and
deciding when to redirect on its own. Only AuthContext applied the decoded
auth_header_name via setGlobalLitellmHeaderName, so the two trees could
disagree on custom auth headers, and each ran its own login-redirect effect

AuthContext stays the engine: it still resolves uiConfig before clearing
authLoading (so proxy-rooted URLs are correct) and performs the single
decode. useAuthorized now consumes the context and only layers on policy:
the admin_ui_disabled check and the redirect-to-login side effect. Its
return shape is unchanged, so none of the ~85 consumers are touched

Context semantics are aligned to what the hook's consumers already
expected: userRole defaults to formatUserRole("") instead of "", and
showSSOBanner is computed strictly from login_method (default false)
instead of defaulting to true. The context's unused public setters
(setToken, setUserID, setAccessToken, setPremiumUser, setShowSSOBanner)
are dropped from the exported surface; only setUserRole/setUserEmail have
consumers. Decoded-JWT fields keep their legacy `any` typing at the hook
boundary since ~25 call sites rely on it; tightening is a follow-up

The hook's tests now exercise the real provider + hook together with real
JWTs instead of mocking the decode away, which also covers the provider's
expiry and undecodable-token paths
2026-06-09 12:09:48 -07:00
..
e2e_tests test(ui): data-driven App Router migration E2E smoke (default + server-root-path) (#29974) 2026-06-09 10:40:01 -07:00
public Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
scripts feat(ui): include internal routes in the dashboard's generated OpenAPI types (#29885) 2026-06-06 23:05:36 -07:00
src refactor(ui): single auth engine; useAuthorized becomes a policy layer over AuthContext 2026-06-09 12:09:48 -07:00
tests refactor(ui): single auth engine; useAuthorized becomes a policy layer over AuthContext 2026-06-09 12:09:48 -07:00
.env.development hidden dashboard routing, dev and build env files 2025-10-06 19:21:34 -07:00
.env.production remove next env 2026-04-18 16:45:32 -07:00
.npmrc [Fix] CI/Tooling: Correct min-release-age value in .npmrc files 2026-04-29 19:49:27 -07:00
.nvmrc [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
.prettierignore feat(ui): generate dashboard API types from the proxy OpenAPI spec (#29816) 2026-06-05 17:20:01 -07:00
.prettierrc added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
build_release_ui.sh build release ui script 2026-01-17 18:16:14 -08:00
build_ui.sh chore: harden npm supply chain — pin overrides, enforce npm ci, add ignore-scripts (#24838) 2026-03-31 13:41:37 -07:00
build_ui_custom_path.sh chore: harden npm supply chain — pin overrides, enforce npm ci, add ignore-scripts (#24838) 2026-03-31 13:41:37 -07:00
CLAUDE.md feat(ui): generate dashboard API types from the proxy OpenAPI spec (#29816) 2026-06-05 17:20:01 -07:00
eslint-budgets.json ci(ui): frontend-lint job enforcing prettier + eslint on changed files (#29633) 2026-06-04 07:41:31 -07:00
eslint-suppressions.json fix(mcp): load MCP tool configuration tools via the OBO/passthrough-aware GET path (#29960) 2026-06-08 19:58:51 -07:00
eslint.config.mjs feat(ui): generate dashboard API types from the proxy OpenAPI spec (#29816) 2026-06-05 17:20:01 -07:00
knip.json feat(ui): generate dashboard API types from the proxy OpenAPI spec (#29816) 2026-06-05 17:20:01 -07:00
next.config.mjs chore(admin-ui): regenerate static export with trailingSlash: true (#28112) 2026-05-25 21:06:50 -07:00
package-lock.json build(deps): bump pyjwt to 2.13.0 and ws override to 8.20.1 (#29982) 2026-06-08 16:39:21 -07:00
package.json test(ui): data-driven App Router migration E2E smoke (default + server-root-path) (#29974) 2026-06-09 10:40:01 -07:00
postcss.config.js build(ui/litellm-dashboard): initial commit of litellm dashboard 2024-01-27 12:12:48 -08:00
README.md build(ui/litellm-dashboard): initial commit of litellm dashboard 2024-01-27 12:12:48 -08:00
tailwind.config.js added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
tailwind.config.ts added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
tsconfig.json style(ui): run prettier --write across the dashboard (#29622) 2026-06-04 11:37:54 -07:00
tsconfig.tsbuildinfo [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
ui_colors.json added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
vitest.config.ts [Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides 2026-04-09 23:58:35 -07:00

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.