Inject session for vanilla ajax requests

This commit is contained in:
Matthew Ryan Dillon 2015-10-20 16:09:51 -07:00
parent bbcef5459e
commit f06fbd0305
5 changed files with 17 additions and 5 deletions
app/pods/protected/users/changepassword

View file

@ -2,6 +2,7 @@ import Ember from 'ember';
import ajaxRequest from '../../../../utils/ajax-request';
export default Ember.Controller.extend({
session: Ember.inject.service('session'),
currentUser: Ember.inject.service('session-account'),
passwordConfirm: null,
@ -22,7 +23,7 @@ export default Ember.Controller.extend({
password: this.get('password'),
},
};
ajaxRequest(url, options);
ajaxRequest(url, options, this.get('session'));
this.transitionTo('protected.users.index');
this.get('flashMessages').information('Your password has been changed.');
},