From d299a07a84c61e50b7840765eb84e184fd318147 Mon Sep 17 00:00:00 2001 From: Leo Correa Date: Sun, 24 Sep 2023 14:02:54 -0400 Subject: [PATCH] Move from authorizers to authorize function authorizers were deprecated and removed in v2 of ember-simple-auth. This is a pretty old version of the addon but doing these small upgrades should help in the long run --- frontend/app/adapters/application.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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); + } }); -