fix
This commit is contained in:
@@ -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> || {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user