Sending cookies with fetch, bg color change

This commit is contained in:
MrFry 2020-04-08 18:12:08 +02:00
parent 0ba12f4d67
commit 179aa6ebfa
4 changed files with 7 additions and 5 deletions

View file

@ -52,7 +52,9 @@ export default function Index (props) {
setData(null)
const toFetch = `${constants.apiUrl}data.json`
console.info('Fetching', toFetch)
fetch(toFetch)
fetch(toFetch, {
credentials: 'include'
})
.then((resp) => {
if (resp && resp.ok) {
return resp.json()