Files
commander_league_web/services/authenticatedFetchService.js
2020-10-26 19:00:28 +00:00

11 lines
265 B
JavaScript

export const authorisedFetchGet = (url, token) => {
return fetch(url, {
method: "GET",
headers: new Headers({
"Content-Type": "application/json",
Authorization: token,
}),
credentials: "same-origin",
}).then((res) => res.json());
};