Closed carlrosell closed 7 years ago
I noticed that the auth middleware just stopped working when updating to v2.0.0.
Here is the working config that was used before:
export const networkLayer = (store: Store<*, *>): RelayNetworkLayer => new RelayNetworkLayer( [ urlMiddleware({ url: graphQLURL }), authMiddleware({ token: () => store.getState().auth.accessToken, tokenRefreshPromise: () => refreshToken(store.dispatch), }), next => req => { req.headers['X-Stats-Timeout'] = statisticsTimeout; return next(req); }, ], { disableBatchQuery: true }, );
I then removed the batchQuery config as it was moved to another middleware but the auth middleware stopped working. It crashes on the, recently added, thrown error inside of the fetchWithMiddlewares-function https://github.com/nodkz/react-relay-network-layer/blob/master/src/fetchWithMiddleware.js#L25.
fetchWithMiddlewares
By throwing there the 401 error does not reach the 401 check inside of the authMiddleweare.
authMiddleweare
If you need more info just let me know ๐
Thanks for reporting. Please check new version. Should be published in a couple of minutes.
That was fast ๐ Thanks
I noticed that the auth middleware just stopped working when updating to v2.0.0.
Here is the working config that was used before:
I then removed the batchQuery config as it was moved to another middleware but the auth middleware stopped working. It crashes on the, recently added, thrown error inside of the
fetchWithMiddlewares
-function https://github.com/nodkz/react-relay-network-layer/blob/master/src/fetchWithMiddleware.js#L25.By throwing there the 401 error does not reach the 401 check inside of the
authMiddleweare
.If you need more info just let me know ๐