Closed krbrs closed 1 year ago
Isn't there a string to grep for in the response body to indicate that the 400 is because the app authentication is still pending?
Asking since a 400 response code in HTTP is used for any generic errors, and it would be bad for Trakt to reserve the code exclusively for pending auth. errors.
For the auth workflow 400 is "pending" - hence the introduction of a new SendDataAuth function:
https://trakt.docs.apiary.io/#reference/authentication-devices/device-code
400 - Pending - waiting for the user to authorize your app
For other requests 400 will be handled as before, because:
https://trakt.docs.apiary.io/#introduction/status-codes
400 - Bad Request - request couldn't be parsed
Blame Trakt for using 400 for this 🙄
...to actually show a correct message instead of throwing an exception.
According to the API, it means: "400 Pending - waiting for the user to authorize your app" So error 400 keeps showing until Trakt is correctly authorized/linked and approved using the displayed code.
Created a new helper SendDataAuth which handles HTTP 400 differently from other SendData and also made changes to show the correct messages in Shoko logs.
closes #1062