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

fix: use updated csrf token on first login #117

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

manchenkoff
Copy link
Owner

@manchenkoff manchenkoff commented Jun 25, 2024

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.

Checklist:

  • Code style and linters are passing
  • Backwards compatibility is maintained
  • Documentation is updated

@manchenkoff manchenkoff self-assigned this Jun 25, 2024
@manchenkoff manchenkoff linked an issue Jun 25, 2024 that may be closed by this pull request
@manchenkoff manchenkoff merged commit 782af6a into main Jun 26, 2024
3 checks passed
@manchenkoff manchenkoff deleted the 108-csrf-token-mismatch-error branch June 26, 2024 17:08
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

Successfully merging this pull request may close these issues.

CSRF token mismatch error
1 participant