Can or should I be able to handle the InvalidCsrfToken error from rack_csrf?

I’ve been working through Darren’s excellent Jump Start Sinatra and I was looking at how authorize and secure.

I did find the rack_csrf gem and was looking at the Sinatra example

I’m pretty new to Ruby and Sinatra as well as just understanding HTTP CSRF attacks, so I might be going the wrong way, but if I wanted to show something like a 404 or any error that would be triggered by InvalidCsrfToken, can I do that? Is that something that I can add or is it better to have the request/response fail silently?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.