openfoodfacts-dart icon indicating copy to clipboard operation
openfoodfacts-dart copied to clipboard

fix: Better error message when searching with wrong credentials

Open M123-dev opened this issue 2 years ago • 4 comments

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 avatar Jul 18 '22 21:07 M123-dev

😅 👌

teolemon avatar Jul 18 '22 21:07 teolemon

@M123-dev @monsieurtanuki Why are we sending credentials on a read query in the first place ?

teolemon avatar Sep 18 '22 15:09 teolemon

@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). Capture d’écran 2022-09-18 à 18 16 09

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?

monsieurtanuki avatar Sep 18 '22 16:09 monsieurtanuki

Looks reasonable on my side. Regular credentials are for : edits, photo upload Robotoff has specific credentials and does not expect a user password

teolemon avatar Sep 18 '22 16:09 teolemon

@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.

monsieurtanuki avatar Aug 30 '23 07:08 monsieurtanuki

No problem

Maybe I'll find time this weekend to follow up with the changes from the last couple of weeks

M123-dev avatar Aug 30 '23 07:08 M123-dev