send cookie with request

This commit is contained in:
Pavel Mineev
2021-02-04 12:13:52 -06:00
committed by Umputun
parent 807249db5d
commit 656ab84381
+1 -1
View File
@@ -58,7 +58,7 @@ const createFetcher = (baseUrl: string = ''): Methods => {
}
try {
const res = await fetch(url, { ...params, headers });
const res = await fetch(url, { ...params, headers, credentials: 'same-origin', mode: 'same-origin' });
// TODO: it should be clarified when frontend gets this header and what could be in it to simplify this logic and cover by tests
const date = (res.headers.has('date') && res.headers.get('date')) || '';
const timestamp = isNaN(Date.parse(date)) ? 0 : Date.parse(date);