1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Add ember-simple-auth, setup login

- Allow dropdown-buttons to render a partial
This commit is contained in:
Toby Zerner
2015-01-30 12:21:18 +10:30
parent 9886fb1f7a
commit c2feae406d
17 changed files with 334 additions and 69 deletions

View File

@@ -0,0 +1,11 @@
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);
}
}
});