Fix re-authentication
This commit is contained in:
@@ -22,14 +22,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
||||
}
|
||||
if (networkError) {
|
||||
if (networkError.statusCode === 401) {
|
||||
webAuth.checkSession((response) => {
|
||||
const oldHeaders = operation.getContext().headers;
|
||||
operation.setContext({
|
||||
headers: {
|
||||
...oldHeaders,
|
||||
Authorization: `Bearer ${webAuth.accessToken()}`,
|
||||
},
|
||||
});
|
||||
webAuth.checkSession(() => {
|
||||
return forward(operation);
|
||||
}, (err) => {
|
||||
console.log(err);
|
||||
|
||||
Reference in New Issue
Block a user