fenichelar/ember-simple-auth-token

In JWT, 'makeRequest' fetching now requires the data to be under "response.json" instead of the root "response"

homeslicesolutions-zz opened this issue · 1 comments

There has been a breaking change after 4.0.2 where the object retrieved from "makeRequest" required the data to be under "response.json" when in the past the object itself was the data. This is causing an error since we're overriding the "makeRequest" function. What I suggest is that in your jwt.js file that it should be this instead:

  authenticate(credentials, headers) {
    return this.makeRequest(this.serverTokenEndpoint, credentials, assign({}, this.headers, headers))
      .then(response => {
        return this.handleAuthResponse(response.json || response);
      });
  },

Your thoughts?

@homeslicesolutions Unfortunately, this was a breaking change if makeRequest was overridden. To keep things clean and easy to understand, I'm not sure we will want to support the older design any more.