0

I have built an MERN application Built an login route and i have 2 JWT tokens one is Access Token and another one Refresh Token

Whats the proper way to store this token in frontend? I'm setting both the token in http only cookie But axios interceptor will send back both the jwt tokens every time in each requests.

So storing in local storage is bad option as i know

What's the proper process? I need refresh token only when access token is expired.

Can anyone please guide me the proper way of doing MERN application? In every tutorials they setting the http only cookie for access token and refresh token through the response body. In that case how to handle in frontend? Where exactly storing it?

Varun Deva
  • 51
  • 1
  • 9
  • You can take a look at [this answer](https://stackoverflow.com/a/69631673/16648127) detailing access/refresh token work flows. – Enfield Li Oct 21 '22 at 08:59

0 Answers0