Skip to content

Commit

Permalink
Update token middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
nz-m authored Sep 6, 2023
1 parent f02b094 commit b972334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/middlewares/tokenMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const tokenMiddleware = (store) => (next) => async (action) => {
const refreshToken = state.auth.refreshToken;
try {
await store.dispatch(refreshTokenAction(refreshToken));
const newToken = store.getState().auth.accessToken;
const newToken = store?.getState().auth.accessToken;

if (!newToken) {
throw new Error("Access token not found after refresh");
Expand Down

0 comments on commit b972334

Please sign in to comment.