diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-01-01 21:28:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-01-01 21:28:33 +0900 |
| commit | 1d31f2ec8921bb58d74458b057bbb31f4877c335 (patch) | |
| tree | 695e24534c9529d4271aa7ed544eaadb697c93b6 /src/client/pages/LoginPage.test.tsx | |
| parent | bf286c11d3244afb5132271dac656109934150e0 (diff) | |
| download | kioku-1d31f2ec8921bb58d74458b057bbb31f4877c335.tar.gz kioku-1d31f2ec8921bb58d74458b057bbb31f4877c335.tar.zst kioku-1d31f2ec8921bb58d74458b057bbb31f4877c335.zip | |
fix(auth): redirect to login when session expires
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>
Diffstat (limited to 'src/client/pages/LoginPage.test.tsx')
| -rw-r--r-- | src/client/pages/LoginPage.test.tsx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/client/pages/LoginPage.test.tsx b/src/client/pages/LoginPage.test.tsx index e4dac95..a3efa8d 100644 --- a/src/client/pages/LoginPage.test.tsx +++ b/src/client/pages/LoginPage.test.tsx @@ -16,6 +16,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( |
