Static-cache-safe CSRF input#14625
Conversation
Up to brandon, but I like this better.
|
@timkelty Would it make more sense to return a placeholder |
@brandonkelly for that reason, I don't think so – we can achieve the same thing with However, if we wanted to support multiple forms/csrfs with a single Blitz's CSRF tags do this, but I thought it was maybe too much for the initial core functionality. |
|
In theory each CSRF input will have the same name and value right? So it might make sense to just set a |
The way it is implemented now, each instance will get a new CSRF…which initially I was thinking was desirable, but I guess there's no reason they couldn't all be the same, right? |
|
The token values will be different each time, but as long as the user session doesn’t change, any of them will work in place of one another. And they can be reused—Craft’s control panel JS will just get a single CSRF token, and reuse it for each Ajax request. |
@brandonkelly ok, refactored.
|
Description
\craft\config\GeneralConfig::$asyncCsrfInputscsrfInputoptions now take aasyncboolean to override the\craft\config\GeneralConfig::$asyncCsrfInputsdefault