mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 15:43:59 +08:00
11 lines
325 B
JavaScript
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);
|
||
|
}
|
||
|
}
|
||
|
});
|