Is your PR related to a specific issue/feature? Please describe and mention issues.
Closes #108 and probably related #6 (comments from @alecritson).
Due to the Nuxt hack with the runWithContext call for request/response interceptors, there was an edge case when cookies after refresh were not included in the result headers due to missing await keyword, thus CSRF token was missing or was used from the previous API response.
Additional context
This PR changes how the Nuxt instance will be passed to each interceptor. Now each interceptor is wrapped with the current instance context instead of running a loop with one instance.
Is your PR related to a specific issue/feature? Please describe and mention issues.
Closes #108 and probably related #6 (comments from @alecritson).
Due to the Nuxt hack with the
runWithContext
call for request/response interceptors, there was an edge case when cookies after refresh were not included in the result headers due to missingawait
keyword, thus CSRF token was missing or was used from the previous API response.Additional context
This PR changes how the Nuxt instance will be passed to each interceptor. Now each interceptor is wrapped with the current instance context instead of running a loop with one instance.
Checklist: