Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Headers with authorization not working #176

Closed
arthurhamon opened this issue May 28, 2018 · 4 comments
Closed

New Headers with authorization not working #176

arthurhamon opened this issue May 28, 2018 · 4 comments

Comments

@arthurhamon
Copy link

Hi,

Can you update the documentation to show an exemple of usage for custom headers in findall, findrecords etc request.
Since you update to HttClient, you break the usage of custom Header.

Thanks

@hpawe01
Copy link
Contributor

hpawe01 commented May 28, 2018

Hey @arthurhamon,

there is a testcase for this: https://github.com/ghidoz/angular2-jsonapi/blob/master/src/services/json-api-datastore.service.spec.ts#L119

And since the testcase doesn't fail it should still work.

Can you specify how it exactly fails (e.g. error message) and a example snippet?

@arthurhamon
Copy link
Author

arthurhamon commented May 28, 2018

capture

And the code associated

const headers = new Headers({'Authorization': 'Basic ' + user.basic});
.findAll( User, { include: GET_USER_INCLUDES, filter: { 'uid': { value: uid } } }, headers, this._appInit.getApiUrl(DRUPALCONSTANT.user_endpoint) )

@arthurhamon
Copy link
Author

Problem solved !
Just remove the import of Header from @angular/http

Thanks for watching

@hpawe01
Copy link
Contributor

hpawe01 commented May 28, 2018

That was, what I just wanted to suggest ;)
Cool that it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants