I successfully retrieved the API token using the code changes presented in this issue:
Working correctly now.