How to implement CSRF protection with Canjs?

28 Views Asked by At

I am looking for any help on how to implement CSRF protection with Canjs. Is there a native support for Canjs for this? If not how can I implement CSRF protection in a Canjs application? I am using Canjs 2.3.

1

There are 1 best solutions below

0
On

With CanJS 2.3, jQuery or your other underlying library is responsible for ajax() calls, so you can use any CSRF protection method available to the underlying library. For jQuery, you can set it up in $.ajaxPrefilter as shown in the answers to Adding CSRFToken to Ajax request