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

Missing authorization header with @hoodie/client dependency #652

Closed
sdvg opened this issue Dec 21, 2016 · 6 comments
Closed

Missing authorization header with @hoodie/client dependency #652

sdvg opened this issue Dec 21, 2016 · 6 comments

Comments

@sdvg
Copy link
Contributor

sdvg commented Dec 21, 2016

I found this mysterious issue: When I have both hoodie and @hoodie/client in my package.json, all PouchDB API requests lack the authorization header and fail with a 401 Unauthorized response.

I built a simple test case for that. Steps to reproduce:

git clone https://github.com/sdvg/hoodie-authhe-bug.git
cd hoodie-authhe-bug/
npm install
npm start -- --in-memory

Then open a browser tab with http://localhost:8080/ and open the console. You should see something like:

Signed up!
Signed in!
GET http://localhost:8080/hoodie/store/api/user%2F1aaxotp/ 401 (Unauthorized)
GET http://localhost:8080/hoodie/store/api/user%2F1aaxotp/ 401 (Unauthorized)
GET http://localhost:8080/hoodie/store/api/user%2F1aaxotp/ 401 (Unauthorized)
[...]

When you inspect one of the failing requests you should see that there is no "authorization" request header.

@gr2m
Copy link
Member

gr2m commented Dec 21, 2016

I was able to reproduce the error, looking into it

@gr2m
Copy link
Member

gr2m commented Dec 21, 2016

Notes to self:

@gr2m
Copy link
Member

gr2m commented Dec 22, 2016

Unrelated to this issue, I found another bug: hoodiehq/hoodie-server#524 :)

@gr2m
Copy link
Member

gr2m commented Dec 22, 2016

okay seems like this is the problem: pouchdb/pouchdb#6053. I’ll fix it in @hoodie/store-client

gr2m added a commit to hoodiehq/hoodie-client that referenced this issue Dec 22, 2016
gr2m added a commit to hoodiehq/hoodie-client that referenced this issue Dec 22, 2016
@gr2m
Copy link
Member

gr2m commented Dec 22, 2016

@sdvg should be fixed via https://github.com/hoodiehq/hoodie-client/releases/tag/v8.0.1 and https://github.com/hoodiehq/hoodie-store-client/releases/tag/v6.0.2. rm -rf node_modules && npm install should fix it for your case

@sdvg
Copy link
Contributor Author

sdvg commented Dec 22, 2016

Yes, that fixed it 🎉
Thank you!

@sdvg sdvg closed this as completed Dec 22, 2016
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