samedi 9 mai 2015

Where should I put my CSRF token in my Ember app?

I have a csrf token dumped into a JS variable on window. I have a form that makes AJAX requests (without Ember Data) from the controller. In my request I need to pass along the csrf token. Where are the recommended places to put this token in Ember? Right now I am grabbing it off window but I realize this is bad for testability. My first thought is to register it into the container. I'm pretty new to Ember so any feedback would be much appreciated!




Aucun commentaire:

Enregistrer un commentaire