0

We are getting the below error in Sitecore Forms on Production site. enter image description here

We are using Sitecore 9.1.1 version with SXA.

I went through many articles/blogs but could not find anything relevant Please suggest.

5
  • Did you check this article related to the caching? madhuanbalagan.com/… Jul 5 at 15:22
  • I have already checked this link and we are not using cache in our site.
    – Nisha
    Jul 5 at 15:31
  • Did you verify whether anti forgery token is generated by inspecting the form in browser Dev tools. If yes, is token is changing on every refresh? If token itself is not generated, then you have to check the Form.cshtml. @Html.AntiForgeryToken() line should be presented.
    – Thamizh
    Jul 5 at 15:52
  • I have checked all the details and found that token is changing after refreshing the page. Is it possible to get this error after getting 500 error?
    – Nisha
    Jul 5 at 18:22
  • Are you getting 500 error. Did you check event viewer for further details?
    – Thamizh
    Jul 8 at 6:06

1 Answer 1

0

The way Anti-Forgery works in Sitecore is the following:

  1. There should be @Html.AntiForgeryToken() HTML helper in the form razor view
  2. A validation should be made in the forms controller using the [ValidateAntiForgeryToken] action filter

If you have these then an HTML code should be generated like below:

<input name="__RequestVerificationToken" type="hidden" value="xxxx">

Although the blog is about implementing forms in JSS, the concept could be understood from this link: Sitecore JSS Anti-forgery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.