mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-06 04:14:15 +00:00
http() and twelve calls that used fetch directly (uploads, downloads, exports, the report, tool-config and the logs history) each built their own Authorization header. Only http() and the HAR export handled a 401, with two inline copies of the session clean-up, and openSSE had a third. All of them now use apiFetch (src/lib/api-fetch.ts): - 401: clearSession() (src/lib/auth.ts) drops the token and the cookie and goes to /login, then the call throws, as http() did before. - 403: throws ForbiddenError, an ApiError with status 403 and the server's message, ready to show in a toast. ApiError moves to api-fetch.ts and is still exported from api.ts. The SSE client keeps its own fetch and now calls clearSession on a 401.