This commit is contained in:
Matthew Dillon 2015-01-28 12:28:46 -09:00
parent 3efc449e94
commit 2d21a158fe
3 changed files with 4 additions and 4 deletions

View file

@ -27,7 +27,7 @@ export default Base.extend({
Ember.run(function() {
resolve({ token: response.token });
});
}, function(xhr, status, error) {
}, function(xhr) {
var response = JSON.parse(xhr.responseText);
Ember.run(function() {
reject(response.error);
@ -36,7 +36,7 @@ export default Base.extend({
});
},
invalidate: function(data) {
invalidate: function() {
var _this = this;
return new Ember.RSVP.Promise(function(resolve) {
Ember.$.ajax({ url: _this.tokenEndpoint, type: 'DELETE' }).always(function() {

View file

@ -2,7 +2,7 @@ import Ember from 'ember';
import Base from 'simple-auth/authorizers/base';
export default Base.extend({
authorize: function(jqXHR, requestOptions) {
authorize: function(jqXHR) {
if (this.get('session.isAuthenticated') && !Ember.isEmpty(this.get('session.token'))) {
jqXHR.setRequestHeader('Authorization', 'Bearer ' + this.get('session.token'));
}

View file

@ -1,7 +1,7 @@
import Ember from 'ember';
export default Ember.Route.extend({
setupController: function(controller, model) {
setupController: function(controller) {
controller.set('errorMessage', null);
}
});