Skip to content

$inertia.post() results in a 302 redirect. #967

Answered by ajnsn
vannut asked this question in Help
Discussion options

You must be logged in to vote

This is probably a Token Mismatch Redirect because of the "Lax" SameSite policy. The XSRF-TOKEN cookie cannot be accessed when posting to your server via an Iframe.

Jonathan has sum up some more information here: https://inertiajs.com/csrf-protection. You can try to share the token as a prop and then include it in the post data, as mentioned in the beginning of the article.

There may be also other solutions availabe. But they require a more deep understanding what SameSite cookies are and how you need to configure them to keep your app secure.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@vannut
Comment options

@ajnsn
Comment options

@vannut
Comment options

@ajnsn
Comment options

@vannut
Comment options

Answer selected by vannut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants