C
C#5mo ago
gio735

✅ 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 Action
2 Replies
Angius
Angius5mo ago
How exactly are yu doing that?
gio735
gio735OP5mo ago
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
Want results from more Discord servers?
Add your server