mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Fix authenticated requests on Native
This commit is contained in:
parent
2e71ffb3de
commit
cee6ffbf45
@ -10,20 +10,16 @@ class ApiNativeClient implements ApiClient {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
};
|
};
|
||||||
|
|
||||||
const robotToken = systemClient.getItem('robot_token');
|
const sessionid = systemClient.getCookie('sessionid');
|
||||||
if (robotToken) {
|
const csrftoken = systemClient.getCookie('csrftoken');
|
||||||
const sessionid = systemClient.getCookie('sessionid');
|
|
||||||
const csrftoken = systemClient.getCookie('csrftoken');
|
|
||||||
const pubKey = systemClient.getItem('pub_key');
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
...headers,
|
...headers,
|
||||||
...{
|
...{
|
||||||
'X-CSRFToken': csrftoken,
|
'X-CSRFToken': csrftoken,
|
||||||
Cookie: `sessionid=${sessionid};robot_token=${robotToken};csrftoken=${csrftoken};pub_key=${pubKey}`,
|
Cookie: `sessionid=${sessionid};token=${csrftoken}`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return headers;
|
return headers;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user