fix authenticated rowy run calls

This commit is contained in:
shamsmosowi
2022-05-27 19:24:59 +08:00
parent 3daa1b413f
commit 52a193f435

View File

@@ -93,7 +93,7 @@ export const rowyRunAtom = atom((get) => {
const { method, path } = route;
let url = serviceUrl + path;
if (params && params.length > 0) url = url + "/" + params.join("/");
console.log(authToken);
const response = await fetch(url, {
method: method,
mode: "cors",
@@ -101,7 +101,7 @@ export const rowyRunAtom = atom((get) => {
credentials: "same-origin",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + authToken,
Authorization: "Bearer " + authToken.token,
},
redirect: "follow",
referrerPolicy: "no-referrer",