Minor adjustments and fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user