mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-06-30 02:13:11 +03:00
add check for cookie
This commit is contained in:
parent
9710d008f4
commit
3139124132
|
@ -71,7 +71,7 @@
|
||||||
try {
|
try {
|
||||||
return JSON.parse(responseBody);
|
return JSON.parse(responseBody);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (cookies.csrftoken.length) {
|
if (cookies.csrftoken && cookies.csrftoken.length) {
|
||||||
headers['X-CSRFToken'] = cookies.csrftoken.pop();
|
headers['X-CSRFToken'] = cookies.csrftoken.pop();
|
||||||
return getFetch(headers);
|
return getFetch(headers);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user