framework/ember/app/authorizers/flarum.js
Toby Zerner c2feae406d Add ember-simple-auth, setup login
- Allow dropdown-buttons to render a partial
2015-01-30 12:21:18 +10:30

11 lines
325 B
JavaScript

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);
}
}
});