Skip to content

Instantly share code, notes, and snippets.

@jurgenwerk
Created March 23, 2016 15:51
Show Gist options
  • Save jurgenwerk/3503c8b9ba030b25c4ed to your computer and use it in GitHub Desktop.
Save jurgenwerk/3503c8b9ba030b25c4ed to your computer and use it in GitHub Desktop.
import Ember from 'ember';
import AjaxService from 'ember-ajax/services/ajax';
export default AjaxService.extend({
session: Ember.inject.service(),
headers: Ember.computed('session', function() {
const headers = {};
this.get('session').authorize('authorizer:application', (headerName, headerValue) => {
headers[headerName] = headerValue;
});
return headers;
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment