
если можно версию с куки, аксес рефреш токен, с защитой роутов и с тайпскриптом.
The try-catch inside the interceptor does not catch anything, the interceptor keeps looping within itself
The axiosInstance.ts file no longer works with the latest React Query / Typescript (April 2023). Hopefully you can update the article. As someone who is new to React, your approach makes total sense to me, but I'm struggling to figure out how to make it work.
Hi K Srinivas Rao, can I get your email please, I need help with react query and nextjs
Everything was explained pretty nicely. Now I have much more clarity around this topic 👍. Waiting for the backend part..
I would do it slightly differently, I would send the rT in a cookie instead of sending it in the response , and in the frontend I resend this cookie on every request for protected route back to the backend and compare it's value with the original rT sent upon authentication which would be stored in the db, and maybe not storing the tokens in the local storage but rather in the memory.
I would appreciate if you could go into the backend as well 🙃. Great article!
K Srinivas Rao
Frontend Engineer
Kakamotobi
In the
catchin the response interceptor, wouldn't the toast disappear right away due towindow.location.href = window.location.origin?