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 language switcher CSRF error when interacting before login #11528 #11529

Merged
merged 6 commits into from
Oct 21, 2024

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

The language switcher component assumes there is a CSRF token set already, but we weren't setting it before login. This PR now sets the csrf token when we render the language switcher.

To reproduce the problem without this patch:

  • delete cookies
  • enable multiple languages, rebuild frontend
  • load the arches homepage
  • navigate to search (it's an unrelated bug that the switcher is not rendering on the index page, see console errors)
  • switch the language
  • result: csrf error

Issues Solved

Closes #11528

Checklist

  • I targeted one of these branches:
    • dev/7.6.x (main support): crash (unexpected exception)
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Ticket Background

releases/7.6.2.md Outdated Show resolved Hide resolved
releases/7.6.2.md Outdated Show resolved Hide resolved
releases/7.6.2.md Outdated Show resolved Hide resolved
Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@chiatt chiatt merged commit f90e519 into dev/7.6.x Oct 21, 2024
7 checks passed
@chiatt chiatt deleted the jtw/include-csrf-token-with-lang-switch branch October 21, 2024 19:51
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 not set when language switcher is rendered
2 participants