[Rails] Manual implementation of Csrf Protection?

2015-07-23 Thread Wenqin Ye
I am implementing the code in this faye pub/sub tutorial(http://faye.jcoglan.com/security/csrf.html) -- go to the example rails section to see the code I am talking about. What it does is when a message is to be published, it goes through the CsrfProtection class. Session_token comes from the c

[Rails] CSRF protection for faye pub/sub

2015-07-23 Thread Wenqin Ye
I am trying to implement Csrf_protection for faye pub/sub chat app (tutorial is here: http://faye.jcoglan.com/security/csrf.html) class CsrfProtection def incoming(message, request, callback) session_token = request.session['_csrf_token'] message_token = message['ext'] && message['ext'].dele