claude-os/frontend
Rosie Val 9298de1a49 Fix auth so it actually enforces, not just decorates
Two gaps found while wiring auth into the data routes:

1. mcp_server/auth.py: HTTPBearer() defaults to auto_error=True, which
   rejects any request with no Authorization header before
   get_current_user's own "auth not configured -> allow as guest"
   check ever runs. That meant turning on Depends(get_current_user)
   anywhere 401'd every request even with auth fully disabled.
   Switched to auto_error=False and handle the missing-credentials
   case explicitly inside get_current_user instead.

2. Frontend never actually sent the stored token on data requests.
   auth.tsx only attached it to its own /api/auth/me check; api.ts's
   fetch() calls (chat, stats, documents, upload, delete) and every
   axios call elsewhere in the app (projects, kanban, hooks) had no
   Authorization header at all. Added an authHeaders() helper in
   api.ts, and a single axios request interceptor in auth.tsx that
   attaches the token app-wide since every component imports the same
   default axios instance.

Known gap not addressed here: mcp_server/claude_code_mcp.py (the
code-forge stdio MCP server) calls the REST API with no token at all.
Harmless while auth is disabled (current state), but it will start
getting 401'd the moment CLAUDE_OS_EMAIL/PASSWORD are actually set -
needs a service-token bypass if that's ever turned on.
2026-08-22 15:46:45 -04:00
..
e2e Remove test screenshots from tracking 2025-12-02 16:28:24 -06:00
public Cleanup and some docs 2025-11-05 11:12:24 -06:00
src Fix auth so it actually enforces, not just decorates 2026-08-22 15:46:45 -04:00
test-results [Bug] "Configure" window superimposed on underlying UI elements #14 2025-12-02 16:10:07 -06:00
.gitignore Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
eslint.config.js Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
index.html Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
package-lock.json Cleanup and some docs 2025-11-05 11:12:24 -06:00
package.json Cleanup and some docs 2025-11-05 11:12:24 -06:00
playwright.config.ts [Bug] "Configure" window superimposed on underlying UI elements #14 2025-12-02 16:10:07 -06:00
postcss.config.js Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
README.md Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
tailwind.config.js Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
tsconfig.app.json Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
tsconfig.json Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
tsconfig.node.json Major updates to use react and agent os profiles 2025-10-23 19:23:05 -05:00
vite.config.ts Cleanup and some docs 2025-11-05 11:12:24 -06:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])