I'm using the new version of ember-simple-auth, which doesn't automatically anymore add access token to ajax requests that are sent to the server.
I'm using oauth2 authentication, and due to a bad documentation I somehow cannot figure out what and where it would be the right way to set the header token for each ajax request that I do.
Should this code be under the authorize function of the custom authorizer or somewhere else?
this.get('session').authorize('authorizer:some-authorizer', (headerName, headerValue) => {
xhr.setRequestHeader(headerName, headerValue);
});
Any information on setting up this correctly would be highly appreciated!