Skip to content

Instantly share code, notes, and snippets.

@jiripospisil
Last active December 17, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiripospisil/5582787 to your computer and use it in GitHub Desktop.
Save jiripospisil/5582787 to your computer and use it in GitHub Desktop.
App.Auth = Ember.Auth.create({
// ...
modules: ["emberModel"]
});
Ember.Auth.Module.EmberModel = Ember.Object.extend({
init: function() {
this.patch();
},
patch: function() {
var self = this;
if (Ember.RESTAdapter) {
Ember.RESTAdapter.reopen({
_ajax: function(url, params, method) {
var settings = {
url: url,
type: method,
dataType: "json",
data: params
};
return self.auth._request.send(settings);
}
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment