fix(frontend): logout state not shown after JWT expires #40
Reference in New Issue
Block a user
Delete Branch "fix/no-logout-state-after-token-expire"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR addresses the issue where an expired session token would leave the frontend stuck showing the user as logged in, causing raw JSON parsing errors on authenticated pages like "My VoDs" instead of gracefully logging the user out.
The core fix centralizes API request handling in
client.tsthrough newapiFetch/apiFetchRawhelpers that consistently attach credentials and detect 401/403 responses. When an unauthorized response is detected, a globally registered handler is triggered, whichAuthProvideruses to reset the user state and refresh authentication status. All API modules (clips, vods, markers, media, stream, users, jobs) were refactored to route through these shared helpers instead of duplicating raw fetch logic, so auth failures are now handled the same way everywhere.As a result, expired or invalid sessions are now detected consistently across the app, the UI immediately reflects the logged-out state.
Resolves #21
WIP: fix(frontend): logout state not shown after JWT expiresto fix(frontend): logout state not shown after JWT expires