dockyard/ember-appkit-rails — pull request #200 by joefiorini (2014-02-21 20:22:12+00:00)
Title: Reset csrf meta tag based on presence of headers

We're setting up authentication with devise and trying to just use the default session cookies. The only problem, as you probably already know, was resetting the CSRF token after sign-in/sign-out. Since we're already grabbing the token from the meta to send it up to the server, what do you think about adding the following to the `csrf.js` initializer template in the initializer?

This approach is based on the following stack overflow post:

http://stackoverflow.com/questions/20875591/actioncontrollerinvalidauthenticitytoken-in-registrationscontrollercreate

We're setting these headers in an after filter on a custom `SessionsController` that inherits from `Devise::SessionsController`. It would still be on the developer to send those tokens back in a header somewhere, but I think that's reasonable.