6 ms·
Noob question for people: How do I do CSRF token for separate Ember/Angular app? Since Rails can't write the CSRF directly on the front end page, how does CSR
by jsnk 12y ago
Noob question for people:
How do I do CSRF token for separate Ember/Angular app?
Since Rails can't write the CSRF directly on the front end page, how does CSRF work in that case?
- booleanbetrayal 12y agotoken-bearer authentication scheme = 2 birds, 1 stone
- boucher 12y agoIt'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).
- fervisa 12y agoThe 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#L58-L61 https://github.com/rails/jquery-ujs/blob/master/src/rails.js...
- deleted 12y ago[deleted]