aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/api
AgeCommit message (Collapse)Author
2026-01-01refactor(client): migrate API calls to typed RPC clientnsfisis
Replace raw fetch() calls with apiClient.rpc typed client across all modal and page components. This provides better type safety and eliminates manual auth header handling. - Make handleResponse public for component usage - Update all component tests to mock RPC methods instead of fetch - Change POSTGRES_HOST default to kioku-db for Docker compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01fix(auth): redirect to login when session expiresnsfisis
When the refresh token fails (session expired), the ApiClient now notifies the AuthProvider via a callback. This triggers a logout and React state update, causing ProtectedRoute to redirect to /login. Closes #7 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01fix(auth): add automatic token refresh on 401 responsesnsfisis
The client session was too short because access tokens (15 min) weren't being automatically refreshed using the refresh token (7 days). Now the ApiClient intercepts 401 responses, attempts token refresh, and retries the original request. This extends effective session duration to 7 days. Closes #6 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31refactor(client): use Hono InferResponseType for API response typesnsfisis
Replace manually defined AuthResponse and User types with Hono's InferResponseType to automatically derive types from server definitions. This ensures client types stay in sync with server responses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31fix(client): parse nested error object in API responsesnsfisis
Server returns `{ error: { message, code } }` but client expected `{ error: string, code }`, causing "[object Object]" to display on login failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07feat(client): remove registration pagensfisis
2025-12-06feat(client): add API client with auth header supportnsfisis
Implements fetch wrapper that handles JWT authentication, automatic token refresh on 401 responses, and provides typed methods for REST operations. Includes comprehensive tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>