diff --git a/frontend/app/adapters/application.js b/frontend/app/adapters/application.js index c3295e61a..c62d1a127 100644 --- a/frontend/app/adapters/application.js +++ b/frontend/app/adapters/application.js @@ -3,9 +3,15 @@ import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'; import ENV from 'flaredown/config/environment'; export default ActiveModelAdapter.extend(DataAdapterMixin, { - authorizer: 'authorizer:devise', host: ENV.apiHost, namespace: 'api', - coalesceFindRequests: true + coalesceFindRequests: true, + // defaults + // identificationAttributeName: 'email' + // tokenAttributeName: 'token' + authorize(xhr) { + let { email, token } = this.get('session.data.authenticated'); + let authData = `Token token="${token}", email="${email}"`; + xhr.setRequestHeader('Authorization', authData); + } }); -