Skip to content

CSRF: Generated HTML value is "csrf_token" in Dev #59382

Closed Answered by Menelion
Menelion asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you @MatTheCat, solution found.
Here are the steps:

  1. Make sure StimulusBundle is installed and enabled.
  2. Make sure csrf.yaml is present.
  3. In the login.twig.html template replace the CSRF token input with the following:
        <input type="hidden" name="_csrf_token"
        data-controller="csrf-protection"
        value="csrf_token"
        >
  1. Note! You have to clear the cache afterwards (at least, I had to): ./bin/console cache:clear.
  2. Enjoy!

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MatTheCat
Comment options

Comment options

You must be logged in to vote
4 replies
@MatTheCat
Comment options

@Menelion
Comment options

@MatTheCat
Comment options

@Menelion
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Menelion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants