Set header correctly and use current url as returnUrl when checking session
This commit is contained in:
@@ -66,7 +66,7 @@ export default class AuthenticationClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkSession(resolve, reject) {
|
checkSession(resolve, reject) {
|
||||||
this.webAuth.checkSession({state: {}}, (err, result) => {
|
this.webAuth.checkSession({state: {returnUrl: window.location.href}}, (err, result) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err || 'Re-authentication failed');
|
return reject(err || 'Re-authentication failed');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
|||||||
operation.setContext({
|
operation.setContext({
|
||||||
headers: {
|
headers: {
|
||||||
...oldHeaders,
|
...oldHeaders,
|
||||||
authorization: webAuth.idToken(),
|
Authorization: `Bearer ${webAuth.accessToken()}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return forward(operation);
|
return forward(operation);
|
||||||
|
|||||||
Reference in New Issue
Block a user