This commit is contained in:
2026-06-30 14:34:24 +03:30
parent 555e56c50a
commit a25fd73eea
+3
View File
@@ -15,6 +15,9 @@ class ApiClient {
const { token, ...fetchOptions } = options; const { token, ...fetchOptions } = options;
const headers: Record<string, string> = { const headers: Record<string, string> = {
// 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<string, string> || {}), ...(options.headers as Record<string, string> || {}),
}; };