10 lines
329 B
JavaScript
10 lines
329 B
JavaScript
import Ember from 'ember';
|
|
import Base from 'simple-auth/authorizers/base';
|
|
|
|
export default Base.extend({
|
|
authorize: function(jqXHR) {
|
|
if (this.get('session.isAuthenticated') && !Ember.isEmpty(this.get('session.token'))) {
|
|
jqXHR.setRequestHeader('Authorization', 'Bearer ' + this.get('session.token'));
|
|
}
|
|
}
|
|
});
|