From 1d31f2ec8921bb58d74458b057bbb31f4877c335 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 1 Jan 2026 21:28:33 +0900 Subject: fix(auth): redirect to login when session expires MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/client/stores/auth.test.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/stores/auth.test.tsx') diff --git a/src/client/stores/auth.test.tsx b/src/client/stores/auth.test.tsx index 72ab9e3..1769011 100644 --- a/src/client/stores/auth.test.tsx +++ b/src/client/stores/auth.test.tsx @@ -14,6 +14,7 @@ vi.mock("../api/client", () => ({ logout: vi.fn(), isAuthenticated: vi.fn(), getTokens: vi.fn(), + onSessionExpired: vi.fn(() => vi.fn()), }, ApiClientError: class ApiClientError extends Error { constructor( -- cgit v1.2.3-70-g09d2