In my Angular app config I have:
$httpProvider.defaults.headers.common['Custom-Auth-Token'] = ____; $httpProvider.defaults.headers.common['Custom-Auth-Signature'] = ____;
These headers are necessary in order to make ANY API requests to the Rails backend server.
On my Rails backend, I'm using Sorcery and have access to current_user.authentication_token in my controller/views. I thus need to pass this to the angular config.js.erb. Is this even possible?
Another issue I have is that the auth-token will then be hashed with an app secret (this is only available on the Rails server and shouldn't ever be seen in the JavaScript), which becomes the auth-signature. How do I perform this action on the rails side, then pass this to Angular's config?