title: how to go from axios interceptor to then
body: <p>this is my code</p>
  <pre><code>axios
    .post(&quot;/api/addcart&quot;, body)
    .then((response) =&gt; {
      if (response.data.success) {
        alert(&quot;success&quot;);
      } else {
        alert(response.data.message);
        console.log(response.data);
      }
    })      .catch(() =&gt; {
      console.log(&quot;catch&quot;);
    });
  </code></pre>
  <p>Created a logic that re-requests when JWT expires with axios interceptor</p>
  <pre><code> axios.interceptors.response.use(
    function (response) {
  return response;},
  
  async function (error) {
  const originalRequest = error.config;
  console.log(error.response.status);
  if (error.response.status === 406) {
    axios.post(&quot;/api/reissue&quot;).then((response) =&gt; {
      console.log(response.data.success);
      if (response.data.success) {
        originalRequest._retry = true;
        return axios(originalRequest);
      } //Removed irrelevant code for readability
    return;
    // return axios(error.config);
  }
  return Promise.reject(error);
  </code></pre>
  <p>}
  );</p>
  <p>The problem I'm having here is after the reissue(jwt token renewal request) is successful.</p>
  <p>406 is the response code given when the token expires (I set it temporarily)
  I want the alert(success) to be generated by going back to the code above after the access token is updated But this request seems to go to catch</p>
  <p>Going back to the beginning, I want to renew if the token has expired and go back to then if the renewal request is successful, but I don't know how. Please let me know if there is a better way</p>