Minor adjustments and fixes

This commit is contained in:
Patrick Fic
2020-02-19 13:26:50 -08:00
parent 0b47fb166e
commit faed2c32b6
10 changed files with 95 additions and 52 deletions

View File

@@ -33,13 +33,14 @@ const errorLink = onError(
console.log("Got the new token.", token);
window.localStorage.setItem("token", token);
// const oldHeaders = operation.getContext().headers;
// operation.setContext({
// headers: {
// ...oldHeaders,
// authorization: token ? `Bearer ${token}` : ""
// }
// });
const oldHeaders = operation.getContext().headers;
operation.setContext({
headers: {
...oldHeaders,
authorization: token ? `Bearer ${token}` : ""
}
});
console.log(operation.getContext());
// console.log("forward", forward);
// console.log("operation", operation);
return forward(operation);