Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
boucher
· 12y ago · 0 comments
It's generally pretty easy in most frameworks to plug in to all XHR requests (see e.g. jquery's ajaxPrefilter). Then you can simply add a CSRF token to the header of every request (or possibly your authentication details directly).
Comments
[–]
fervisa
12y ago
The Rails unobtrusive adapter for jQuery jquery-ujs has a pretty neat implementation, you can take a look at it here
https://github.com/rails/jquery-ujs/blob/master/src/rails.js...