jeudi 22 septembre 2016

Ember-Simple-Auth / Ember-Simple-Auth-Token does not authorize findAll queries / Safari only

I've got a very weird issue here, maybe some of you have any pointers for me.

I'm using ESA and ESA-token (JWT) to authorize my API requests, using all the appropriate mixins (ApplicationRouteMixin, AuthenticatedRouteMixin etc.)

Developing in Chrome, I see no problem at all. However, when triggering a store.findAll (or an empty store.query, for that matter) query in Safari, the request does not get decorated with the appropriate bearer token. Curiously enough, a call to store.findRecord) passes without problems.

My versions are:

"ember-simple-auth": "1.0.1",
"ember-simple-auth-token": "1.1.1"

The applicable section in environment.js:

'ember-simple-auth' : {
      authenticationRoute: 'login',
      routeAfterAuthentication: 'clients',
      routeIfAlreadyAuthenticated: 'clients',
      authorizer: 'authorizer:token'
    },

  'ember-simple-auth-token': {
      refreshAccessTokens: true,
      timeFactor: 1000,
      refreshLeeway: 300, // Refresh the token 5 minutes (300s) before it expires.,
      identificationField: 'username',
      passwordField: 'password'
  }

And in the application adapter:

authorizer: 'authorizer:token'

enter image description here enter image description here

Now I've also step-by-step debugged this, and what's even more weird, the authorization header is present at the beginning, but gets erased at some point in the wrapping function.

Any pointers would be very appreciated




Aucun commentaire:

Enregistrer un commentaire