[FR] return html meta tags for users/session-info action #17275
Unanswered
leevigraham
asked this question in
Ideas
Replies: 2 comments 2 replies
-
@leevigraham I like that idea! The same could be done via ESIs, which Craft Cloud supports. It feels a little odd to repurpose the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Does make me wonder though…if you already have SSIs – why not just inject the CSRF input directly via SSI, rather than dealing with the additional JS of decoding the meta header and submitting via js? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the
users/session-info
endpoint only accepts json:I have an alternative implementation in my own controller that adds a few extra properties.
While reading this comment: #15427 (reply in thread) @timkelty points out that I could add those extra properties via an event.
However my implementation also returns html
<meta>
tags if the accept content header is notapplication/json
.Why? Well I use nginx server side includes to inject the meta in statically cached pages for an instant load without the additional fetch request.
Here's my version:
Would a PR be considered that returned
<meta>
tags in the case of a HTML request?Beta Was this translation helpful? Give feedback.
All reactions