-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
temp fix for axios #279
temp fix for axios #279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I wonder if the only reason why the bug is happening is just because the code that adds the request and response interceptors aren't being run at all, could something like this work?
/* in `src/App.tsx` */
const App: React.FC = () => {
useEffect(() => addAxiosInterceptors(), []);
}
/* in `src/auth/axios.ts` */
// lines 40 through 97 of `src/App.tsx` in this PR
export const addAxiosInterceptors = () => {
AppAxiosInstance.interceptors.response.use( ... );
AppAxiosInstance.interceptors.request.use((config) => { ... });
}
Still p ugly but at least we're all learning something 🤷 (don't make auth more complicated than it needs to be)
This only worked 100% on my end if I called |
Ah I think this could be because With this being said idk what the best way to get around this would be so I'd say let's just merge this and spend an hour or so to see if we can move the |
Ah that makes sense, thanks for the explanation! |
Checklist
yarn run check
yarn run test
Why
Resolves #
This PR
Screenshots
Verification Steps