openfoodfacts-dart
openfoodfacts-dart copied to clipboard
fix: Better error message when searching with wrong credentials
What
- Fixes: #518
- I analysed the response html and checked, the only thing I could find which is reliable for checking if its a credentials problem even for different languages was the amount of links to
reset_password.pl
😅 👌
@M123-dev @monsieurtanuki Why are we sending credentials on a read query in the first place ?
@M123-dev @monsieurtanuki Why are we sending credentials on a read query in the first place ?
I guess that's a combination of adding user credentials on POST for good reasons (#420), and switching most queries from GET to POST for good reasons (#414).
The solution would be to add an optional parameter to the doPostRequest
method, stating if we want to add user credentials (defaults to false
, would be true
at least for photos) (today implicitly it's true
, which causes the bug).
@teolemon Ok with that fix?
Looks reasonable on my side. Regular credentials are for : edits, photo upload Robotoff has specific credentials and does not expect a user password
@M123-dev We changed a lot the rest of the code since when you initially created this PR. Closing; please create a new PR if needed.
No problem
Maybe I'll find time this weekend to follow up with the changes from the last couple of weeks