Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
custom REST adapter for ember-data that sends the authentication token in a header
App.AuthenticatedRESTAdapter = DS.RESTAdapter.extend({
ajax: function(url, type, hash) {
hash = hash || {};
hash.headers = hash.headers || {};
hash.headers['X-AUTHENTICATION-TOKEN'] = this.authToken;
return this._super(url, type, hash);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment