✅ AutoValidateForgeryToken with fetch API
Hello, how can I pass the forgery token to the fetch API?
I have tried putting it into the header as
X-CSRF-TOKEN
which seemingly creates token cookie, but it still can't reach specific Action2 Replies
How exactly are yu doing that?
Sorry, I couldn't see the message. I just added it to the fetch() headers and as value gave
'@Html.AntiForgeryToken()'
.
made it work by adding @Html.AntiForgeryToken()
as a element and setting it's value as RequestVerificationToken
header