Could not login to Xiaomi Miio Cloud, check the credentials

I successfully retrieved the API token using the code changes presented in this issue:

Working correctly now.