import DeviseAuthenticator from 'ember-simple-auth/authenticators/devise';

export default DeviseAuthenticator.extend();

@@ -1,8 +1,35 @@
+import Ember from 'ember';%0A
 import D
@@ -100,49 +100,1509 @@
 ';%0A%0A
-export default DeviseAuthenticator.extend(
+const %7B RSVP: %7B Promise %7D, run %7D = Ember;%0A%0Aexport default DeviseAuthenticator.extend(%7B%0A  resourceName: 'data',%0A  %0A  authenticate(identification, password) %7B%0A    return new Promise((resolve, reject) =%3E %7B%0A      const useResponse = this.get('rejectWithResponse');%0A      const %7B identificationAttributeName, tokenAttributeName %7D = this.getProperties('resourceName', 'identificationAttributeName', 'tokenAttributeName');%0A      const data = %7B%0A        email: identification,%0A        password: password%0A      %7D;%0A%0A      this.makeRequest(data).then((response) =%3E %7B%0A        if (response.ok) %7B%0A          response.json().then((json) =%3E %7B%0A            const resourceName = this.get('resourceName');%0A%0A            // devise_token_auth provides with the token in the headers%0A            // Copy access-token from headers to json%0A            json%5BresourceName%5D%5BtokenAttributeName%5D = response.headers.get('access-token');%0A%0A            if (this._validate(json)) %7B%0A              const _json = json%5BresourceName%5D ? json%5BresourceName%5D : json;%0A              run(null, resolve, _json);%0A            %7D else %7B%0A              run(null, reject, %60Check that server response includes $%7BtokenAttributeName%7D and $%7BidentificationAttributeName%7D%60);%0A            %7D%0A          %7D);%0A        %7D else %7B%0A          if (useResponse) %7B%0A            run(null, reject, response);%0A          %7D else %7B%0A            response.json().then((json) =%3E run(null, reject, json));%0A          %7D%0A        %7D%0A      %7D).catch((error) =%3E run(null, reject, error));%0A    %7D);%0A  %7D,%0A%7D
 );%0A

Customize devise authenticator to work with devise_token_auth