C
C#6mo 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
Angius6mo ago
How exactly are yu doing that?
gio735
gio735OP6mo 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