From a25fd73eea393fc27fe623ebd178e70c2666052f Mon Sep 17 00:00:00 2001 From: AmirmahdiNourkazemi Date: Tue, 30 Jun 2026 14:34:24 +0330 Subject: [PATCH] fix --- lib/api/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api/client.ts b/lib/api/client.ts index b2c4b25..8c3dbb4 100644 --- a/lib/api/client.ts +++ b/lib/api/client.ts @@ -15,6 +15,9 @@ class ApiClient { const { token, ...fetchOptions } = options; const headers: Record = { + // Always ask for JSON so Laravel returns 401 JSON on auth failure + // instead of a 302 redirect to the login page. + Accept: 'application/json', ...(options.headers as Record || {}), };