Inject session for vanilla ajax requests
This commit is contained in:
parent
bbcef5459e
commit
f06fbd0305
5 changed files with 17 additions and 5 deletions
app/pods/protected/users/changepassword
|
@ -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.');
|
||||
},
|
||||
|
|
Reference in a new issue