framework/ember/app/authorizers/flarum.js

11 lines
320 B
JavaScript
Raw Normal View History

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