Skip to content
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

Not re-firing interceptors.request.use #162

Open
troykelly opened this issue Feb 9, 2021 · 0 comments
Open

Not re-firing interceptors.request.use #162

troykelly opened this issue Feb 9, 2021 · 0 comments

Comments

@troykelly
Copy link

I can't see where we should regenerate headers in the retry process.

We use this to generate the Bearer - but it only ever gets called once, every retry reuses the bearer - which eventually falls outside of the allowed time difference and becomes invalid.

axiosInterceptor.interceptors.request.use(
  async (axiosConfig) => {
    const data = JSON.parse(axiosConfig.data);
    const bearer = getAuthHeader("POST", axiosConfig.url, data);
    debug("Generated bearer: %s", bearer);
    axiosConfig.headers.Authorization = `Bearer ${bearer}`;
    return axiosConfig;
  },
  (error) => {
    Promise.reject(error);
  }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant